AllBASIC

BASIC Developer & Support Resources => Toolbox => Topic started by: John on October 04, 2013, 06:05:45 pm

Title: Claro-AIR
Post by: John on October 04, 2013, 06:05:45 pm
Good to hear from you again AIR. I think you answered Kent's questions with the knowledge he is crossing over (and back again) from Windows and went easy on him.  :D

BTW, did you have a chance to look at Nimrod? I'm curious what your take is on it running GUI apps under OSX.

Title: Re: Claro-AIR
Post by: AIR on October 04, 2013, 06:43:15 pm
Hey, John.

There's no native GUI support under MacOS, unless you use the old Claro library.  Araq has it up on GitHub, and I've spent the last day or two modifying it to work under OSX Mavericks and Mountain Lion.  Claro, unfortunately, is VERY incomplete, but nimrod has an (equally!) incomplete binding for it, so I dusted off the old Tiny Times demo.


Title: Re: Claro-AIR
Post by: AIR on October 04, 2013, 06:50:29 pm
Oh, here's the code.  Definitely not finished, and probably never will be, because Claro needs a major re-write.

Code: [Select]
import claro, strutils

type
  TButtonArray = array[0..9, ptr TButton]

var bTop:cint = 16
var buttons:TButtonArray
var lb: ptr TListBox

proc window_closed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  claro_shutdown()

proc button_pressed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  var seed:cint = 10
  var button = cast[ptr TButton](obj)
  var multiplyer = cast[int](button.naddress[0])
  for i in 1..10:
    discard listbox_append_row( lb, IntToStr(multiplyer) & " x " & IntToStr(i) & " = " & IntToStr( multiplyer*i ) )
     
     
var Form1 = newWindow( nil, new_bounds( 100, 100, 500, 330 ), 1 )
window_set_title( Form1, "Tiny Times Table" )
object_addhandler( Form1, "destroy", window_closed )

lb = newListBox(Form1, new_bounds(bTop,bTop, 300,300), 0)

for i in low(buttons)..high(buttons):
  var val = intToStr(i+1)
  buttons[i] = newButton( Form1, new_bounds( 410, bTop, 70, -1 ), 0, intToStr(i+1) )
  object_addHandler( buttons[i], "pushed", button_pressed)
  buttons[i].naddress[0] = cast[ptr int](i+1)
  bTop+=30


window_show(Form1)
window_focus(Form1)

claro_loop()

EDIT:  fixed typo
Title: Re: Claro-AIR
Post by: John on October 04, 2013, 07:08:38 pm
That is too cool !

It's good to hear the Nimrod author has taken some interest in the OSX platform. I will have to do a search for what Claro is all about.

Thanks for the example.

Quote
===========================================================
          Claro GUI library
===========================================================

This is a revival of the Claro GUI library from Gian Perrone and Theo Julienne.

Claro is a set of cross-platform libraries which assist programmers in writing applications which can run on almost any platform without modification.

This project aims to revive this abandoned project and to provide wrappers for
Nimrod.

To try it out, build it with::
 
  python koch.py claro


Enjoy!
Andreas Rumpf
Title: Re: Claro-AIR
Post by: John on October 04, 2013, 10:53:50 pm
I built and installed the Claro library on Linux (Ubuntu 12.4 64 bit) and here are a few of the examples that are done in C.

(http://files.allbasic.info/Claro/claro_hello.png)

(http://files.allbasic.info/Claro/claro_list.png)

(http://files.allbasic.info/Claro/claro_radio.png)
Title: Re: Claro-AIR
Post by: John on October 05, 2013, 01:07:37 am
jrs@laptop:~/nimrod/examples$ nimrod c air_tt.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: air_tt [Processing]
Hint: claro [Processing]
Hint: cairo [Processing]
lib/wrappers/claro.nim(174, 31) Error: inheritance only works with non-final objects
jrs@laptop:~/nimrod/examples$

This is the error I'm getting trying to compile your Tiny Times Nimrod example under Ubuntu 64 bit.

Update

I thought I had it with this change (https://github.com/Araq/Nimrod/commit/c5926224ad229948fc3baeec83e88047c388a0e5) to nimrod core translator. I recompiled with these changes but it didn't resolve the issue.  :-\

Code: [Select]
Error: inheritance only works with non-final objects
Quote from: Araq
Araq closed the issue in c592622 (https://github.com/Araq/Nimrod/commit/c5926224ad229948fc3baeec83e88047c388a0e5) a month ago
Title: Re: Claro-AIR
Post by: AIR on October 05, 2013, 07:49:58 am
The problem isn't in the compiler, but in the Claro.nim module.

In line 67, change this:
Code: [Select]
TClaroObj*{.pure.} = object
So that it looks like this:
Code: [Select]
TClaroObj*{.pure, inheritable.} = object
Without that change, you can't sub-class TClaroObj.

AIR.
Title: Re: Claro-AIR
Post by: John on October 05, 2013, 08:47:02 am
Thanks AIR for the fix but I can't seem to load libclaro.so with Nimrod. I didn't have any problems running the C examples that came with the Claro distribution. The C examples were compiled with Gtk+2.0 and I think Nimrod is using Gtk-3. I tried to compile the Claro hello.c example with Gtk-3 and it wouldn't compile.

Update The Nimrod Gtk example are compiled with Gtk 2 so that doesn't seem the be the issue.

Code: [Select]
jrs@laptop:~/nimrod/examples$ nimrod c -d:release air_tt.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: air_tt [Processing]
Hint: claro [Processing]
Hint: cairo [Processing]
lib/wrappers/claro.nim(466, 13) Hint: 'noBoundsVar' is declared but not used [XDeclaredButNotUsed]
Hint: strutils [Processing]
Hint: parseutils [Processing]
examples/air_tt.nim(14, 10) Hint: 'seed' is declared but not used [XDeclaredButNotUsed]
examples/air_tt.nim(28, 9) Hint: 'val' is declared but not used [XDeclaredButNotUsed]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/air_tt.o examples/nimcache/air_tt.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/system.o examples/nimcache/system.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/claro.o examples/nimcache/claro.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/cairo.o examples/nimcache/cairo.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/strutils.o examples/nimcache/strutils.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/parseutils.o examples/nimcache/parseutils.c
gcc   -o /home/jrs/nimrod/examples/air_tt  examples/nimcache/parseutils.o examples/nimcache/strutils.o examples/nimcache/cairo.o examples/nimcache/claro.o examples/nimcache/system.o examples/nimcache/air_tt.o  -ldl
Hint: operation successful (12653 lines compiled; 1.793 sec total; 13.133MB) [SuccessX]
jrs@laptop:~/nimrod/examples$ ./air_tt
could not load: libclaro.so
jrs@laptop:~/nimrod/examples$ ls -l /usr/lib/libclaro.so
-rwxrwxr-x 1 root root 815879 Oct  4 20:58 /usr/lib/libclaro.so
jrs@laptop:~/nimrod/examples$
Title: Re: Claro-AIR
Post by: AIR on October 05, 2013, 01:34:40 pm
libclaro is built wrong by koch.py, so it doesn't dynamically link to gtk.

Since you already have the object files after building the library, recreate it like this (from the root of the Claro folder):

Code: [Select]
gcc  -shared -fPIC -o build/libclaro.so  src/block.o src/hashtable.o src/claro.o src/list.o src/log.o src/memory.o src/object.o src/oscompat.o src/store.o src/object_map.o src/widgets/window.o src/widgets/toolbar.o src/widgets/textbox.o src/widgets/button.o src/widgets/canvas.o src/widgets/splitter.o src/widgets/container.o src/widgets/checkbox.o src/widgets/dialog.o src/widgets/label.o src/widgets/progress.o src/widgets/radio.o src/widgets/statusbar.o src/widgets/textarea.o src/widgets/frame.o src/widgets/image.o src/widgets/list.o src/widgets/listbox.o src/widgets/listview.o src/widgets/combo.o src/widgets/menubar.o src/widgets/menu.o src/widgets/scrollbar.o src/widgets/workspace.o src/widgets/opengl.o src/widgets/treeview.o src/widgets/stock.o src/layout_parser.o src/layout.o src/layout_heap.o src/widget.o src/graphics.o src/image.o src/font.o src/system.o src/platform/gtk.o src/platform/gdkcairo.o src/platform/gtkcairo.o src/platform/gtk/window.o src/platform/gtk/toolbar.o src/platform/gtk/textbox.o src/platform/gtk/button.o src/platform/gtk/canvas.o src/platform/gtk/splitter.o src/platform/gtk/container.o src/platform/gtk/label.o src/platform/gtk/statusbar.o src/platform/gtk/progressbar.o src/platform/gtk/checkbox.o src/platform/gtk/radio.o src/platform/gtk/textarea.o src/platform/gtk/frame.o src/platform/gtk/image.o src/platform/gtk/listview.o src/platform/gtk/listbox.o src/platform/gtk/combo.o src/platform/gtk/menubar.o src/platform/gtk/menu.o src/platform/gtk/scrollbar.o src/platform/gtk/workspace.o src/platform/gtk/opengl.o src/platform/gtk/treeview.o src/platform/gtk/font.o src/platform/gtk/images.o src/platform/gtk/system.o -ldl $(pkg-config --libs gtk+-2.0)
EDIT:
Or use the attached koch.py file that I fixed.
Title: Re: Claro-AIR
Post by: John on October 05, 2013, 02:29:31 pm
It's nice to have a Nimrod pro as a member of the forum. Thanks AIR!

(http://files.allbasic.info/Claro/claro_air_tt.png)

This is the C source Nimrod generated for AIR's Tiny Times example.

Code: [Select]
/* Generated by Nimrod Compiler v0.9.2 */
/*   (c) 2012 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
   gcc -c  -w  -I/home/jrs/nimrod/lib -o examples/nimcache/air_tt.o examples/nimcache/air_tt.c */
#define NIM_INTBITS 64
#include "nimbase.h"
typedef struct tbutton69623 tbutton69623;
typedef struct tlistbox70325 tlistbox70325;
typedef struct tclaroobj69074 tclaroobj69074;
typedef struct tevent69076 tevent69076;
typedef struct twidget69240 twidget69240;
typedef struct tlist69005 tlist69005;
typedef struct tnode69003 tnode69003;
typedef struct tbounds69225 tbounds69225;
typedef struct tfont69236 tfont69236;
typedef struct tlistitem69881 tlistitem69881;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct twindow71186 twindow71186;
typedef struct tlistwidget69883 tlistwidget69883;
typedef struct tcolor69238 tcolor69238;
typedef struct timage69305 timage69305;
typedef tbutton69623* tbuttonarray79003[10];
typedef N_CDECL_PTR(void, TY69206) (void);
typedef NIM_CHAR TY69083[64];
struct tlist69005 {
tnode69003* Head;
tnode69003* Tail;
NI32 Count;
};
struct tclaroobj69074 {
TY69083 Typ;
int Destroypending;
tlist69005 Eventhandlers;
tlist69005 Children;
tclaroobj69074* Parent;
void* Appdata;
};
struct tbounds69225 {
int X;
int Y;
int W;
int H;
tclaroobj69074* Owner;
};
struct tfont69236 {
int Used;
NCSTRING Face;
int Size;
int Weight;
int Slant;
int Decoration;
void* Native;
};
typedef void* TY69266[4];
struct twidget69240 {
  tclaroobj69074 Sup;
tbounds69225* Sizereq;
tbounds69225 Size;
tbounds69225 Sizect;
int Supportsalpha;
int Sizeflags;
int Flags;
int Visible;
int Notifyflags;
tfont69236 Font;
void* Native;
void* Ndata;
void* Container;
TY69266 Naddress;
};
typedef NIM_CHAR TY69624[256];
struct tbutton69623 {
  twidget69240 Sup;
TY69624 Text;
};
typedef N_CDECL_PTR(tlistitem69881*, TY70350) (tlistbox70325* listbox, NCSTRING text);
struct TGenericSeq {
NI len;
NI reserved;
};
typedef NIM_CHAR TY611[100000001];
struct NimStringDesc {
  TGenericSeq Sup;
TY611 data;
};
typedef N_CDECL_PTR(twindow71186*, TY71208) (tclaroobj69074* parent, tbounds69225* bounds, int flags);
typedef N_CDECL_PTR(tbounds69225*, TY69490) (int x, int y, int w, int h);
typedef N_CDECL_PTR(void, TY71218) (twindow71186* w, NCSTRING title);
typedef N_CDECL_PTR(void, teventfunc69078) (tclaroobj69074* obj, tevent69076* event);
typedef N_CDECL_PTR(void, TY69170) (tclaroobj69074* obj, NCSTRING event, teventfunc69078 func);
typedef N_CDECL_PTR(tlistbox70325*, TY70331) (tclaroobj69074* parent, tbounds69225* bounds, int flags);
typedef N_CDECL_PTR(tbutton69623*, TY69644) (tclaroobj69074* parent, tbounds69225* bounds, int flags, NCSTRING label);
typedef N_CDECL_PTR(void, TY71225) (twindow71186* w);
typedef N_CDECL_PTR(void, TY71237) (twindow71186* w);
typedef N_CDECL_PTR(void, TY69200) (void);
struct tlistwidget69883 {
  twidget69240 Sup;
int Columns;
NI32* Coltypes;
tlist69005 Items;
};
struct tlistbox70325 {
  tlistwidget69883 Sup;
tlistitem69881* Selected;
};
typedef NIM_CHAR TY69099[16];
struct tevent69076 {
tclaroobj69074* Obj;
TY69083 Name;
int Handled;
int Argnum;
TY69099 Format;
void** Arglist;
};
struct tnode69003 {
tnode69003* Next;
tnode69003* Prev;
void* Data;
};
struct tcolor69238 {
int Used;
float R;
float G;
float B;
float A;
};
struct tlistitem69881 {
  tclaroobj69074 Sup;
int Row;
void* Native;
NI Nativeid;
tclaroobj69074* Menu;
int Enabled;
void** Data;
tlist69005 Listitemchildren;
tlist69005* Listitemparent;
tlistitem69881* Parentitem;
tcolor69238 Textcolor;
tcolor69238 Seltextcolor;
tcolor69238 Backcolor;
tcolor69238 Selbackcolor;
tfont69236 Font;
};
typedef NIM_CHAR TY71187[512];
struct twindow71186 {
  twidget69240 Sup;
TY71187 Title;
timage69305* Icon;
twidget69240* Menubar;
twidget69240* Workspace;
int Exsptools;
int Exspstatus;
int Exspinit;
};
struct timage69305 {
  tclaroobj69074 Sup;
int Width;
int Height;
void* Native;
void* Native2;
void* Native3;
void* Icon;
};
N_CDECL(void, windowclosed_79017)(tclaroobj69074* obj, tevent69076* event);
static N_INLINE(void, nimFrame)(TFrame* s);
static N_INLINE(void, popFrame)(void);
N_CDECL(void, buttonpressed_79025)(tclaroobj69074* obj, tevent69076* event);
N_NIMCALL(NimStringDesc*, nsuIntToStr)(NI x, NI minchars);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NI, mulInt)(NI a, NI b);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(NI, addInt)(NI a, NI b);
N_NOINLINE(void, raiseOverflow)(void);
static N_INLINE(void, initStackBottom)(void);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
N_NOINLINE(void, systemInit)(void);
N_NOINLINE(void, systemDatInit)(void);
N_NOINLINE(void, cairoInit)(void);
N_NOINLINE(void, cairoDatInit)(void);
N_NOINLINE(void, claroInit)(void);
N_NOINLINE(void, claroDatInit)(void);
N_NOINLINE(void, parseutilsInit)(void);
N_NOINLINE(void, parseutilsDatInit)(void);
N_NOINLINE(void, strutilsInit)(void);
N_NOINLINE(void, strutilsDatInit)(void);
N_NOINLINE(void, air_ttInit)(void);
N_NOINLINE(void, air_ttDatInit)(void);
STRING_LITERAL(TMP144, " x ", 3);
STRING_LITERAL(TMP145, " = ", 3);
int btop_79007;
tbuttonarray79003 buttons_79010;
tlistbox70325* lb_79014;
extern TY69206 Dl_69205;
extern TFrame* frameptr_10225;
extern TY70350 Dl_70349;
twindow71186* form1_79060;
extern TY71208 Dl_71207;
extern TY69490 Dl_69489;
extern TY71218 Dl_71217;
extern TY69170 Dl_69169;
extern TY70331 Dl_70330;
NI i_79093;
extern TY69644 Dl_69643;
extern TY71225 Dl_71224;
extern TY71237 Dl_71236;
extern TY69200 Dl_69199;

static N_INLINE(void, nimFrame)(TFrame* s) {
(*s).prev = frameptr_10225;
frameptr_10225 = s;
}

static N_INLINE(void, popFrame)(void) {
frameptr_10225 = (*frameptr_10225).prev;
}

N_CDECL(void, windowclosed_79017)(tclaroobj69074* obj, tevent69076* event) {
nimfr("window_closed", "air_tt.nim")
nimln(11, "air_tt.nim");
Dl_69205();
popFrame();
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
memcpy(((NCSTRING) (&(*dest).data[((*dest).Sup.len)- 0])), ((NCSTRING) ((*src).data)), (NI64)((*src).Sup.len + 1));
(*dest).Sup.len += (*src).Sup.len;
}

static N_INLINE(NI, addInt)(NI a, NI b) {
NI result;
NIM_BOOL LOC2;
result = 0;
result = (NI)((NU64)(a) + (NU64)(b));
LOC2 = (0 <= (NI)(result ^ a));
if (LOC2) goto LA3;
LOC2 = (0 <= (NI)(result ^ b));
LA3: ;
if (!LOC2) goto LA4;
{
goto BeforeRet;
}
LA4: ;
raiseOverflow();
BeforeRet: ;
return result;
}

N_CDECL(void, buttonpressed_79025)(tclaroobj69074* obj, tevent69076* event) {
int seed;
tbutton69623* button;
NI multiplyer;
NI i_79042;
NI res_79047;
nimfr("button_pressed", "air_tt.nim")
nimln(14, "air_tt.nim");
seed = ((int) 10);
nimln(15, "air_tt.nim");
button = ((tbutton69623*) (obj));
nimln(16, "air_tt.nim");
multiplyer = ((NI) ((*button).Sup.Naddress[(0)- 0]));
i_79042 = 0;
nimln(1289, "system.nim");
res_79047 = 1;
nimln(1290, "system.nim");
while (1) {
NimStringDesc* LOC2;
NimStringDesc* LOC3;
NimStringDesc* LOC4;
NI TMP146;
NimStringDesc* LOC5;
tlistitem69881* LOC6;
nimln(1290, "system.nim");
if (!(res_79047 <= 10)) goto LA1;
nimln(1289, "system.nim");
i_79042 = res_79047;
nimln(18, "air_tt.nim");
nimln(18, "air_tt.nim");
nimln(18, "air_tt.nim");
LOC2 = 0;
nimln(18, "air_tt.nim");
LOC3 = 0;
LOC3 = nsuIntToStr(multiplyer, 1);
nimln(18, "air_tt.nim");
LOC4 = 0;
LOC4 = nsuIntToStr(i_79042, 1);
nimln(18, "air_tt.nim");
nimln(18, "air_tt.nim");
TMP146 = mulInt(multiplyer, i_79042);
LOC5 = 0;
LOC5 = nsuIntToStr((NI64)(TMP146), 1);
LOC2 = rawNewString(LOC3->Sup.len + LOC4->Sup.len + LOC5->Sup.len + 6);
appendString(LOC2, LOC3);
appendString(LOC2, ((NimStringDesc*) &TMP144));
appendString(LOC2, LOC4);
appendString(LOC2, ((NimStringDesc*) &TMP145));
appendString(LOC2, LOC5);
LOC6 = Dl_70349(lb_79014, LOC2->data);
nimln(1292, "system.nim");
res_79047 = addInt(res_79047, 1);
} LA1: ;
popFrame();
}

static N_INLINE(void, initStackBottom)(void) {
void* volatile locals;
locals = 0;
locals = ((void*) (&locals));
setStackBottom(locals);
}
int cmdCount;
char** cmdLine;
char** gEnv;
N_CDECL(void, NimMain)(void) {
systemDatInit();
cairoDatInit();
claroDatInit();
parseutilsDatInit();
strutilsDatInit();
air_ttDatInit();
initStackBottom();
systemInit();
cairoInit();
claroInit();
parseutilsInit();
strutilsInit();
air_ttInit();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_NOINLINE(void, air_ttInit)(void) {
tbounds69225* LOC1;
tbounds69225* LOC2;
NI res_79114;
nimfr("air_tt", "air_tt.nim")
nimln(6, "air_tt.nim");
btop_79007 = ((int) 16);
nimln(21, "air_tt.nim");
nimln(21, "air_tt.nim");
LOC1 = Dl_69489(((int) 100), ((int) 100), ((int) 500), ((int) 330));
form1_79060 = Dl_71207(NIM_NIL, LOC1, ((int) 1));
nimln(22, "air_tt.nim");
Dl_71217(form1_79060, "Tiny Times Table");
nimln(23, "air_tt.nim");
Dl_69169(&form1_79060->Sup.Sup, "destroy", windowclosed_79017);
nimln(25, "air_tt.nim");
nimln(25, "air_tt.nim");
LOC2 = Dl_69489(btop_79007, btop_79007, ((int) 300), ((int) 300));
lb_79014 = Dl_70330(&form1_79060->Sup.Sup, LOC2, ((int) 0));
nimln(1289, "system.nim");
res_79114 = 0;
nimln(1290, "system.nim");
while (1) {
NimStringDesc* val;
NI TMP147;
tbounds69225* LOC4;
NI TMP148;
NimStringDesc* LOC5;
NI TMP149;
nimln(1290, "system.nim");
if (!(((NI) (res_79114)) <= 9)) goto LA3;
nimln(1289, "system.nim");
i_79093 = res_79114;
nimln(28, "air_tt.nim");
nimln(28, "air_tt.nim");
TMP147 = addInt(((NI) (i_79093)), 1);
val = nsuIntToStr(((NI) ((NI64)(TMP147))), 1);
nimln(29, "air_tt.nim");
nimln(29, "air_tt.nim");
LOC4 = Dl_69489(((int) 410), btop_79007, ((int) 70), ((int) -1));
nimln(29, "air_tt.nim");
nimln(29, "air_tt.nim");
TMP148 = addInt(((NI) (i_79093)), 1);
LOC5 = 0;
LOC5 = nsuIntToStr(((NI) ((NI64)(TMP148))), 1);
buttons_79010[(i_79093)- 0] = Dl_69643(&form1_79060->Sup.Sup, LOC4, ((int) 0), LOC5->data);
nimln(30, "air_tt.nim");
Dl_69169(&buttons_79010[(i_79093)- 0]->Sup.Sup, "pushed", buttonpressed_79025);
nimln(31, "air_tt.nim");
nimln(31, "air_tt.nim");
TMP149 = addInt(((NI) (i_79093)), 1);
(*buttons_79010[(i_79093)- 0]).Sup.Naddress[(0)- 0] = ((void*) (((NI*) ((NI64)(TMP149)))));
nimln(32, "air_tt.nim");
btop_79007 = addInt(btop_79007, ((int) 30));
nimln(1292, "system.nim");
res_79114 = addInt(res_79114, 1);
} LA3: ;
nimln(35, "air_tt.nim");
Dl_71224(form1_79060);
nimln(36, "air_tt.nim");
Dl_71236(form1_79060);
nimln(38, "air_tt.nim");
Dl_69199();
popFrame();
}

N_NOINLINE(void, air_ttDatInit)(void) {
}

Title: Re: Claro-AIR
Post by: John on October 05, 2013, 03:21:30 pm
I tried to bring this full circle and compile the Nimrod Claro Tiny Times example from AIR on Windows XP. I have posted Nimrod examples on this platform before so I know it works.

Code: [Select]
F:\Nimrod\Claro-master>python koch.py claro
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32.o src\platform\win32.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\window.o src\platform\win32\window.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\toolbar.o src\platform\win32\toolbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\textbox.o src\platform\win32\textbox.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\button.o src\platform\win32\button.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\canvas.o src\platform\win32\canvas.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\splitter.o src\platform\win32\splitter.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\container.o src\platform\win32\container.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\label.o src\platform\win32\label.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\statusbar.o src\platform\win32\statusbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\progressbar.o src\platform\win32\progressbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\checkbox.o src\platform\win32\checkbox.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\radio.o src\platform\win32\radio.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\textarea.o src\platform\win32\textarea.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\frame.o src\platform\win32\frame.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\image.o src\platform\win32\image.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\listbox.o src\platform\win32\listbox.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\listview.o src\platform\win32\listview.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\combo.o src\platform\win32\combo.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\menubar.o src\platform\win32\menubar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\menu.o src\platform\win32\menu.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\scrollbar.o src\platform\win32\scrollbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\workspace.o src\platform\win32\workspace.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\opengl.o src\platform\win32\opengl.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\treeview.o src\platform\win32\treeview.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\pngdib.o src\platform\win32\pngdib.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\font.o src\platform\win32\font.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\images.o src\platform\win32\images.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\system.o src\platform\win32\system.c
[Koch] gcc  src\block.o src\hashtable.o src\claro.o src\list.o src\log.o src\memory.o src\object.o src\oscompat.o src\store.o
 src\object_map.o src\widgets\window.o src\widgets\toolbar.o src\widgets\textbox.o src\widgets\button.o src\widgets\canvas.o
src\widgets\splitter.o src\widgets\container.o src\widgets\checkbox.o src\widgets\dialog.o src\widgets\label.o src\widgets\pr
ogress.o src\widgets\radio.o src\widgets\statusbar.o src\widgets\textarea.o src\widgets\frame.o src\widgets\image.o src\widge
ts\list.o src\widgets\listbox.o src\widgets\listview.o src\widgets\combo.o src\widgets\menubar.o src\widgets\menu.o src\widge
ts\scrollbar.o src\widgets\workspace.o src\widgets\opengl.o src\widgets\treeview.o src\widgets\stock.o src\layout_parser.o sr
c\layout.o src\layout_heap.o src\widget.o src\graphics.o src\image.o src\font.o src\system.o src\platform\win32.o src\platfor
m\win32\window.o src\platform\win32\toolbar.o src\platform\win32\textbox.o src\platform\win32\button.o src\platform\win32\can
vas.o src\platform\win32\splitter.o src\platform\win32\container.o src\platform\win32\label.o src\platform\win32\statusbar.o
src\platform\win32\progressbar.o src\platform\win32\checkbox.o src\platform\win32\radio.o src\platform\win32\textarea.o src\p
latform\win32\frame.o src\platform\win32\image.o src\platform\win32\listbox.o src\platform\win32\listview.o src\platform\win3
2\combo.o src\platform\win32\menubar.o src\platform\win32\menu.o src\platform\win32\scrollbar.o src\platform\win32\workspace.
o src\platform\win32\opengl.o src\platform\win32\treeview.o src\platform\win32\pngdib.o src\platform\win32\font.o src\platfor
m\win32\images.o src\platform\win32\system.o  -lgdi32 -lcomctl32 -lole32 -lmsvcp60 -lMsimg32 -lopengl32 -lglu32 -lpng -lz -sh
ared -o build\claro.dll
src\block.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
[Koch] *** ERROR: execution of an external program failed

F:\Nimrod\Claro-master>
Title: Re: Claro-AIR
Post by: John on October 05, 2013, 04:06:47 pm
With a bit of farting around, I was able to get AIR's Tiny Times example to compile on Windows.  (like walking through a mine field)

Code: [Select]
F:\Nimrod\examples>nimrod c air_tt.nim
f:\nimrod\config\nimrod.cfg(36, 11) Hint: added path: 'C:\Documents and Settings\John\.babel\libs\' [Path]
Hint: used config file 'F:\Nimrod\config\nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: air_tt [Processing]
Hint: claro [Processing]
Hint: cairo [Processing]
f:\nimrod\lib\wrappers\claro.nim(466, 13) Hint: 'noBoundsVar' is declared but not used [XDeclaredButNotUsed]
Hint: strutils [Processing]
Hint: parseutils [Processing]
air_tt.nim(14, 10) Hint: 'seed' is declared but not used [XDeclaredButNotUsed]
air_tt.nim(28, 9) Hint: 'val' is declared but not used [XDeclaredButNotUsed]
gcc.exe   -o f:\nimrod\examples\air_tt.exe  f:\nimrod\examples\nimcache\parseutils.o f:\nimrod\examples\nimcache\strutils.o f
:\nimrod\examples\nimcache\cairo.o f:\nimrod\examples\nimcache\claro.o f:\nimrod\examples\nimcache\system.o f:\nimrod\example
s\nimcache\air_tt.o
Hint: operation successful (12803 lines compiled; 4.356 sec total; 11.117MB) [SuccessX]

F:\Nimrod\examples>air_tt
could not load: libcairo-2.dll

F:\Nimrod\examples>

Title: Re: Claro-AIR
Post by: John on October 05, 2013, 05:57:06 pm
I can't post the screen shot because the window only stay on the screen for a fraction of a second. I was able to get by the previous FreeType6.dll issue by copying the one from the Gtk2 for Windows install. It now looks like its down to AIR's Nimrod program and nil.

Code: [Select]
F:\Nimrod\examples>air_tt
[2013-10-05 17:51:09 at unknown_application src\list.c:26 in list_init] allocating in list_init( );
[2013-10-05 17:51:09 at unknown_application src\block.c:142 in block_alloc] block_alloc( heap=003e63d8 ) -> 003e6448
[2013-10-05 17:51:09 at unknown_application src\block.c:142 in block_alloc] block_alloc( heap=003e6538 ) -> 003e65a8
Traceback (most recent call last)
air_tt.nim(38)           air_tt
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

F:\Nimrod\examples>

air_tt.nim(38)

claro_loop()


Title: Re: Claro-AIR
Post by: kryton9 on October 05, 2013, 06:18:37 pm
Responses inline, I couldn't ignore this post... :-*
...

All in all, your ideas are interesting, but (just my opinion) they aren't practical.

AIR.

Thanks for taking the time to reply in depth AIR, I appreciate it a lot.

I tried to try debian, but it would not see my wireless network device and said I needed a proprietary driver. So I couldn't install it.
Will try it in virtualbox instead of stand alone next.

Thanks again for taking the time to reply and clarify.
Title: Re: Claro-AIR
Post by: AIR on October 05, 2013, 08:49:59 pm


Thanks for taking the time to reply in depth AIR, I appreciate it a lot.

I tried to try debian, but it would not see my wireless network device and said I needed a proprietary driver. So I couldn't install it.
Will try it in virtualbox instead of stand alone next.

Thanks again for taking the time to reply and clarify.

If you're going the Virtual route (I run VMWare Fusion on my Macs and have my virtual machines on a portable drive) take a look a Linux Mint 15.  Really nice distro, I've switched all of my Linux stuff to it. Also, Distrowatch (http://distrowatch.com/) has release info for just about every Linux distro that matters.


AIR. 
Title: Re: Claro-AIR
Post by: John on October 05, 2013, 08:52:27 pm
I inserted the following user input statement just before the message loop that causes the crash. My guess at this point is the reason the message loop is crying is that no controls got created which in turn is sending null pointers to it. It looks like the Windows portion of Claro is broken. I'm leaving this in AIR's hands as I'm not sure where to look.

Code: [Select]
var dummy = readLine(stdin)

It may not mean much to most but once this works, one Nimrod program will generate the native GUI C code required to support it on OSX, Linux and Windows.

(http://files.allbasic.info/Claro/claro_xp_tt.png)


If you want to give Nimrod a try online using a browser interface, (I can see smiles of tablet owners already) it's one of the many languages supported on compileonline</>com (http://www.compileonline.com/compile_nimrod_online.php)
Title: Re: Claro-AIR
Post by: kryton9 on October 05, 2013, 11:49:09 pm
Quote
If you're going the Virtual route (I run VMWare Fusion on my Macs and have my virtual machines on a portable drive) take a look a Linux Mint 15.  Really nice distro, I've switched all of my Linux stuff to it. Also, Distrowatch has release info for just about every Linux distro that matters.

Since I eventually want to do opengl stuff, I wanted to have hardware 3d acceleration and virtualbox is supposed to support that. So I installed it and debian amd64.

So far, so good. I installed git, cloned Nimrod and just finished building it from source. So far I am getting farther along in Debian than I did with Ubuntu. Did you guys install Babel (https://github.com/Araq/Nimrod/wiki/Getting-Started#babel), the Nimrod package manager?
Title: Re: Claro-AIR
Post by: John on October 06, 2013, 12:24:49 am
Thanks! That is really a nice way to keep your Nimrod libraries up to date.

Code: [Select]
jrs@laptop:~/nimrod/babel-master$ ls -l
total 404
-rwxrwxr-x 1 jrs jrs 332373 Oct  6 00:13 babel
-rw-rw-r-- 1 jrs jrs    207 Oct  5 11:14 babel.babel
drwx--x--x 3 jrs jrs   4096 Oct  6 00:13 babel-master
-rw-rw-r-- 1 jrs jrs  12080 Oct  5 11:14 babel.nim
-rw-rw-r-- 1 jrs jrs      7 Oct  5 11:14 babel.nimrod.cfg
-rw-rw-r-- 1 jrs jrs    314 Oct  5 11:14 common.nim
-rw-rw-r-- 1 jrs jrs   4031 Oct  5 11:14 download.nim
-rw-rw-r-- 1 jrs jrs   1624 Oct  5 11:14 license.txt
-rw-rw-r-- 1 jrs jrs   8680 Oct  5 11:14 packageinfo.nim
-rw-rw-r-- 1 jrs jrs   8949 Oct  5 11:14 readme.markdown
-rw-rw-r-- 1 jrs jrs    603 Oct  5 11:14 todo.markdown
-rw-rw-r-- 1 jrs jrs   1681 Oct  5 11:14 tools.nim
-rw-rw-r-- 1 jrs jrs   6503 Oct  5 11:14 version.nim
jrs@laptop:~/nimrod/babel-master$ ./babel update
Downloading package list from https://github.com/nimrod-code/packages/raw/master/packages.json
Done.
jrs@laptop:~/nimrod/babel-master$
jrs@laptop:~/nimrod/babel-master$ ./babel install
Installing babel-0.1.0
Building babel/babel using c backend...
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: used config file '/home/jrs/nimrod/babel-master/babel.nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: babel [Processing]
Hint: httpclient [Processing]
Hint: sockets [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: openssl [Processing]
Hint: parseurl [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: parseopt [Processing]
Hint: osproc [Processing]
Hint: streams [Processing]
Hint: pegs [Processing]
Hint: unicode [Processing]
Hint: tables [Processing]
Hint: math [Processing]
Hint: packageinfo [Processing]
Hint: parsecfg [Processing]
Hint: lexbase [Processing]
Hint: json [Processing]
Hint: version [Processing]
Hint: common [Processing]
Hint: tools [Processing]
Hint: download [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o babel-master/nimcache/babel.o babel-master/nimcache/babel.c
gcc   -o /home/jrs/nimrod/babel-master/babel  babel-master/nimcache/download.o babel-master/nimcache/tools.o babel-master/nimcache/common.o babel-master/nimcache/version.o babel-master/nimcache/json.o babel-master/nimcache/lexbase.o babel-master/nimcache/parsecfg.o babel-master/nimcache/packageinfo.o babel-master/nimcache/math.o babel-master/nimcache/tables.o babel-master/nimcache/unicode.o babel-master/nimcache/pegs.o babel-master/nimcache/streams.o babel-master/nimcache/osproc.o babel-master/nimcache/parseopt.o babel-master/nimcache/hashes.o babel-master/nimcache/strtabs.o babel-master/nimcache/parseurl.o babel-master/nimcache/openssl.o babel-master/nimcache/posix.o babel-master/nimcache/times.o babel-master/nimcache/parseutils.o babel-master/nimcache/strutils.o babel-master/nimcache/os.o babel-master/nimcache/sockets.o babel-master/nimcache/httpclient.o babel-master/nimcache/system.o babel-master/nimcache/babel.o  -ldl -lm
Hint: operation successful (24985 lines compiled; 1.180 sec total; 42.435MB) [SuccessX]
/home/jrs/nimrod/babel-master/tools.nim -> /home/jrs/.babel/pkgs/babel-0.1.0/tools.nim
/home/jrs/nimrod/babel-master/readme.markdown -> /home/jrs/.babel/pkgs/babel-0.1.0/readme.markdown
/home/jrs/nimrod/babel-master/babel.nim -> /home/jrs/.babel/pkgs/babel-0.1.0/babel.nim
/home/jrs/nimrod/babel-master/license.txt -> /home/jrs/.babel/pkgs/babel-0.1.0/license.txt
/home/jrs/nimrod/babel-master/babel.babel -> /home/jrs/.babel/pkgs/babel-0.1.0/babel.babel
/home/jrs/nimrod/babel-master/babel.nimrod.cfg -> /home/jrs/.babel/pkgs/babel-0.1.0/babel.nimrod.cfg
/home/jrs/nimrod/babel-master/babel.babel -> /home/jrs/.babel/pkgs/babel-0.1.0/babel.babel
/home/jrs/nimrod/babel-master/packageinfo.nim -> /home/jrs/.babel/pkgs/babel-0.1.0/packageinfo.nim
/home/jrs/nimrod/babel-master/common.nim -> /home/jrs/.babel/pkgs/babel-0.1.0/common.nim
/home/jrs/nimrod/babel-master/todo.markdown -> /home/jrs/.babel/pkgs/babel-0.1.0/todo.markdown
/home/jrs/nimrod/babel-master/download.nim -> /home/jrs/.babel/pkgs/babel-0.1.0/download.nim
/home/jrs/nimrod/babel-master/version.nim -> /home/jrs/.babel/pkgs/babel-0.1.0/version.nim
/home/jrs/nimrod/babel-master/babel -> /home/jrs/.babel/pkgs/babel-0.1.0/babel
/home/jrs/nimrod/babel-master/babel.babel -> /home/jrs/.babel/pkgs/babel-0.1.0/babel.babel
Creating symlink: /home/jrs/.babel/pkgs/babel-0.1.0/babel -> /home/jrs/.babel/bin/babel
babel installed successfully.
jrs@laptop:~/nimrod/babel-master$
jrs@laptop:~/nimrod/babel-master$ ./babel --help
Usage: babel COMMAND [opts]

Commands:
  install      [pkgname, ...] Installs a list of packages.
  build                       Builds a package.
  update       [url]          Updates package list. A package list URL can be optionally specified.
  search       pkg/tag        Searches for a specified package. Search is performed by tag and by name.
  list                        Lists all packages.

Options:
  -h                          Print this help message.
  -v                          Print version information.

jrs@laptop:~/nimrod/babel-master$ ./babel list
argument_parser:
  url:         git://github.com/gradha/argument_parser/ (git)
  tags:        library, commandline, arguments, switches, parsing
  description: Provides a complex commandline parser
  license:     MIT
 
genieos:
  url:         git://github.com/gradha/genieos/ (git)
  tags:        library, commandline, sound, recycle, os
  description: Too awesome procs to be included in nimrod.os module
  license:     MIT
 
jester:
  url:         git://github.com/dom96/jester/ (git)
  tags:        web, http, framework, dsl
  description: A sinatra-like web framework for Nimrod.
  license:     MIT
 
libtcod-nim:
  url:         git://github.com/Vladar4/libtcod-nim/ (git)
  tags:        roguelike, game, library, engine, sdl, opengl, glsl
  description: Wrapper of the libtcod library for the Nimrod language.
  license:     MIT
 
nimepak:
  url:         git://github.com/gradha/epak/ (git)
  tags:        library, serialization, file, compression
  description: File compression routines in C for iOS and Nimrod
  license:     Allegro 4 Giftware
 
nimgame:
  url:         git://github.com/Vladar4/nimgame/ (git)
  tags:        game, engine, sdl
  description: Simple 2D game engine for Nimrod language.
  license:     MIT
 
sfml:
  url:         git://github.com/fowlmouth/nimrod-sfml/ (git)
  tags:        game, library, opengl
  description: High level OpenGL-based Game Library
  license:     MIT
 
enet:
  url:         git://github.com/fowlmouth/nimrod-enet/ (git)
  tags:        game, networking, udp
  description: Wrapper for ENet UDP networking library
  license:     MIT
 
nim-locale:
  url:         git://github.com/Amrykid/nim-locale/ (git)
  tags:        library, locale, i18n, localization, localisation, globalization
  description: A simple library for localizing Nimrod applications.
  license:     MIT
 
fowltek:
  url:         git://github.com/fowlmouth/nimlibs/ (git)
  tags:        game, opengl, wrappers, library, assorted
  description: A collection of reusable modules and wrappers.
  license:     MIT
 
nake:
  url:         git://github.com/fowlmouth/nake/ (git)
  tags:        build, automation, sortof
  description: make-like for Nimrod. Describe your builds as tasks!
  license:     DATWPL
 
nimrod-glfw:
  url:         git://github.com/rafaelvasco/nimrod-glfw/ (git)
  tags:        library, glfw, opengl, windowing, game
  description: Nimrod bindings for GLFW library.
  license:     MIT
 
chipmunk:
  url:         git://github.com/fowlmouth/nimrod-chipmunk/ (git)
  tags:        library, physics, game
  description: Binding for Chipmunk 6.1
  license:     MIT
 
nim-glfw3:
  url:         git://github.com/EXetoC/nim-glfw3/ (git)
  tags:        library, glfw, opengl, windowing, game
  description: A High-level GLFW 3 wrapper for the Nimrod programming language
  license:     MIT
 
nim-ao:
  url:         git://github.com/EXetoC/nim-ao/ (git)
  tags:        library, audio
  description: A libao wrapper for the Nimrod programming language
  license:     MIT
 
termbox:
  url:         git://github.com/fowlmouth/nim-termbox (git)
  tags:        library, terminal, io
  description: Termbox wrapper.
  license:     MIT
 
linagl:
  url:         https://bitbucket.org/TheLonelyByte/linagl (hg)
  tags:        library, opengl, math, game
  description: OpenGL math library
  license:     CC0
 
kwin:
  url:         git://github.com/reactormonk/nim-kwin (git)
  tags:        library, javascript, kde
  description: KWin JavaScript API wrapper
  license:     MIT
 
opencv:
  url:         git://github.com/dom96/nim-opencv (git)
  tags:        library, wrapper, opencv, image, processing
  description: OpenCV wrapper
  license:     MIT
 
babel:
  url:         git://github.com/nimrod-code/babel (git)
  tags:        app, binary, package, manager
  description: Babel package manager
  license:     BSD
 
aporia:
  url:         git://github.com/nimrod-code/Aporia (git)
  tags:        app, binary, ide, gtk, nimrod
  description: A Nimrod IDE.
  license:     GPLv2
 
ipsumgenera:
  url:         git://github.com/dom96/ipsumgenera (git)
  tags:        app, binary, blog, static, generator
  description: Static blog generator ala Jekyll.
  license:     MIT
 
jrs@laptop:~/nimrod/babel-master$

To rebuild babel:

jrs@laptop:~/nimrod/babel-master$ ./babel build
Building babel/babel using c backend...
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: used config file '/home/jrs/nimrod/babel-master/babel.nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: babel [Processing]
Hint: httpclient [Processing]
Hint: sockets [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: openssl [Processing]
Hint: parseurl [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: parseopt [Processing]
Hint: osproc [Processing]
Hint: streams [Processing]
Hint: pegs [Processing]
Hint: unicode [Processing]
Hint: tables [Processing]
Hint: math [Processing]
Hint: packageinfo [Processing]
Hint: parsecfg [Processing]
Hint: lexbase [Processing]
Hint: json [Processing]
Hint: version [Processing]
Hint: common [Processing]
Hint: tools [Processing]
Hint: download [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o babel-master/nimcache/babel.o babel-master/nimcache/babel.c
gcc   -o /home/jrs/nimrod/babel-master/babel  babel-master/nimcache/download.o babel-master/nimcache/tools.o babel-master/nimcache/common.o babel-master/nimcache/version.o babel-master/nimcache/json.o babel-master/nimcache/lexbase.o babel-master/nimcache/parsecfg.o babel-master/nimcache/packageinfo.o babel-master/nimcache/math.o babel-master/nimcache/tables.o babel-master/nimcache/unicode.o babel-master/nimcache/pegs.o babel-master/nimcache/streams.o babel-master/nimcache/osproc.o babel-master/nimcache/parseopt.o babel-master/nimcache/hashes.o babel-master/nimcache/strtabs.o babel-master/nimcache/parseurl.o babel-master/nimcache/openssl.o babel-master/nimcache/posix.o babel-master/nimcache/times.o babel-master/nimcache/parseutils.o babel-master/nimcache/strutils.o babel-master/nimcache/os.o babel-master/nimcache/sockets.o babel-master/nimcache/httpclient.o babel-master/nimcache/system.o babel-master/nimcache/babel.o  -ldl -lm
Hint: operation successful (24985 lines compiled; 1.168 sec total; 42.435MB) [SuccessX]
jrs@laptop:~/nimrod/babel-master$
Title: Re: Claro-AIR
Post by: kryton9 on October 06, 2013, 01:03:41 am
John, my babel from git is missing files. Where did you get your babel sources from?

Quote
k9@deb:~/Nimrod/babel$ ls -l
total 72
-rw-r--r-- 1 root root   207 Oct  6 03:28 babel.babel
-rw-r--r-- 1 root root 12080 Oct  6 03:28 babel.nim
-rw-r--r-- 1 root root     7 Oct  6 03:28 babel.nimrod.cfg
-rw-r--r-- 1 root root   314 Oct  6 03:28 common.nim
-rw-r--r-- 1 root root  4031 Oct  6 03:28 download.nim
-rw-r--r-- 1 root root  1624 Oct  6 03:28 license.txt
-rw-r--r-- 1 root root  8680 Oct  6 03:28 packageinfo.nim
-rw-r--r-- 1 root root  8949 Oct  6 03:28 readme.markdown
-rw-r--r-- 1 root root   603 Oct  6 03:28 todo.markdown
-rw-r--r-- 1 root root  1681 Oct  6 03:28 tools.nim
-rw-r--r-- 1 root root  6503 Oct  6 03:28 version.nim

The compile-online screenshot of Nimrod is neat! Something else to try after I get this going.

Update: The Git Clone is missing stuff. I downloaded the zip file for Babel. Got it working now.
Title: Re: Claro-AIR
Post by: John on October 06, 2013, 08:57:52 am
I used the zip from github to build babel. Glad to hear you got your copy running.

Title: Re: Claro-AIR
Post by: AIR on October 06, 2013, 11:04:37 am
FYI, I pushed my changes to the Claro library up to my GitHub space.  You can grab the current version via: https://github.com/Airr/Claro.git

Also, I sort of finished off the TT demo so that now it properly updates as you click the different buttons:

Code: [Select]
import claro, strutils
 
type
  TButtonArray = array[0..9, ptr TButton]

var bTop:cint = 16
var buttons:TButtonArray
var text: ptr TTextArea

proc window_closed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  claro_shutdown()

proc button_pressed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  var buf =""
  var seed:cint = 10
  var button = cast[ptr TButton](obj)
  var multiplyer = cast[int](button.naddress[0])
  for i in 1..10:
    buf &= IntToStr(multiplyer) & " x " & IntToStr(i) & " = " & IntToStr( multiplyer*i ) & "\n"

  textarea_set_text(text,buf)


var Form1 = newWindow( nil, new_bounds( 100, 100, 420, 330 ), 2 )
window_set_title( Form1, "Tiny Times Table" )
object_addhandler( Form1, "destroy", window_closed )

text = newTextArea(Form1, new_bounds(bTop,bTop, 300,300), 0)

for i in low(buttons)..high(buttons):
  var val = intToStr(i+1)
  buttons[i] = newButton( Form1, new_bounds( 334, bTop, 70, -1 ), 0, intToStr(i+1) )
  object_addHandler( buttons[i], "pushed", button_pressed)
  buttons[i].naddress[0] = cast[ptr int](i+1)
  bTop+=30


window_show(Form1)
window_focus(Form1)

claro_loop()
Title: Re: Claro-AIR
Post by: John on October 06, 2013, 11:27:33 am
Thank You!

We are so fortunate to have a IT professional of your caliber participating in the Nimrod project. You are a model others should follow if open source interests them.

Title: Re: Claro-AIR
Post by: AIR on October 06, 2013, 12:07:17 pm
I don't know about all that, I just have some free time this weekend and I'm bored....

AIR.
Title: Re: Claro-AIR
Post by: John on October 06, 2013, 12:10:09 pm
Your free time is priceless here.

Title: Re: Claro-AIR
Post by: John on October 06, 2013, 12:58:44 pm
(http://files.allbasic.info/Claro/claro_air_tt_linux.png)

The Claro-AIR built fine on Ubuntu 64 bit. Your fix to TTT is a nice addition.

I think I'll go abuse myself and try this on XP.  :(
Title: Re: Claro-AIR
Post by: AIR on October 06, 2013, 02:53:34 pm
The MAC portion of Claro throws a lot of warnings, which I'm slowly working through.  Quite a bit of the functions called were deprecated back in OSX 10.3 (Current is 10.9!)

It was also missing the TextArea widget, and setting widget Fonts, which I've added. There are also other items missing, which I'm hoping to address.

Haven't commited the changes yet, still have a lot to clean up.  I'll work through this over the next few weeks, time permitting.

This library has the potential to provide the missing path that may allow various BASICS (and other languages) to provide a Native GUI on the Mac platform.

AIR.

Title: Re: Claro-AIR
Post by: John on October 06, 2013, 03:20:49 pm
That's a good point you made that Claro isn't just a Nimrod thing.

Title: Re: Claro-AIR
Post by: John on October 06, 2013, 03:51:20 pm
@AIR - No change on the Windows XP front with the new build of Claro.  :(

http://files.allbasic.info/Claro/test.swf

Quote
About Claro Graphics

Claro Graphics ("claro.graphics") is a Graphical User Interface (GUI) platform abstraction
library for C and other languages. Claro Graphics is different to most other graphics
toolkits in that it doesn't try to re-invent the wheel, but rather is a layer above the existing
toolkits available (Win32 API, GTK, Cocoa, ...). The result is that applications look and function
like the user expects on their respective system.

Claro Graphics is a module of the "Claro":http://www.libclaro.org/ framework. Claro aims to
provide a large array of useful tools for software developers that, where needed, use the native OSs
functions to provide faster/cleaner results.

However, it doesn't just end there. We do believe in inventing new systems that make life
easier, so we provide great time-saving options like our advanced layout engine called
"Layout Expression Language (LEL)":intro.html

The simple API of Claro Graphics makes it ideal to use in scripting languages.  We feel
so strongly about this that we're going to strive to support Ruby, Python, and Lua.
This is possible simple because the library consists of very simple C function calls and
simple components.


Where did it start?

Claro was originally started for the open-source rewrite of the "Bersirc":http://bersirc.free2code.net/
IRC client. It seemed like a better idea to write a generic library rather than just writing the client
on 3 different platforms. The existing libraries like Qt and GTK both had flaws on Windows & Mac OS X.
So Claro was born to create a layer over the existing libraries (both graphics and sockets).

Over the years, Claro has had 3 main branches. The first branch was more of a proof of concept, then
came the main stretch as "Claro" (just a GUI toolkit, dispite the original intentions). That branch
ended up hitting a brick wall because of some design flaws, but was kept moving slowly.

In 2005, the "Free2Code":http://www.free2code.net/ IRC network (where Bersirc lives) merged in to
the "AthemeNet":http://www.atheme.net/ Network: the network that houses the development of the
"Atheme IRC Services":http://www.atheme.org/ . It turned out they were also thinking of developing
a library with the original ideas of Claro, so the redesign began: "Claro" became "Claro Graphics"
and their base library became "Claro Base".


The End Of Layout Hell

Claro Graphics uses a very different layout mechanism from other GUI toolkits.
In Claro Graphics you can code your entire GUI layout with a single string called
a 'lelex' (think "regex for LEL").  A lelex tells Claro how to layout your components
such that it doesn't matter how you build the interface, what you place in it, or even
how it's sized.

As an example, here's the entire layout from the canvas-test demo:

Code: [Select]
  bounds_t b = { 50, 50, 220, 220 };
  layout *lt = layout_create( "[][_<a|clock|<a][{40}Red|Green|Blue]", b, 10, 10 );

This small set of code replaces reams and gobs of layout, boxing, packing, and containing
code found in other frameworks.  It also make resizing and altering a layout fast and
trivial to deal with.  The @"[][_<a|clock|<a][{40}Red|Green|Blue]"@ contains the
entire lelex for the interface and is quick to learn (unlike regular expressions).


Native Widgets

Claro Graphics uses the native widget set of the platform rather than our feeble attempts
at gray boxes.  Even though it uses the native widgets Claro Graphics tries to be small and
useful without a lot of bloat and every component under the sun.  Instead, Claro Graphics gives
you enough to get 90% of what you want done, and simple tools to add your own components as
needed.

In addition to native components there's also some included libraries to implement
common things not found on many platforms.  Currently "Cairo":http://www.cairographics.org/
is used as the canvas API.


Cut The Crap

Claro Graphics will *never* make you use crap like GTK's gint, weird string libraries, demanding
excessive external libraries, or included crap that has nothing to do with the task of
making a nice user interface.  It'll always use the most normal C possible in order to make
scripting language hooks simpler to implement.

Claro Graphics will also try to play nicely with other libraries (as long as they play nicely in return).


Simplicity First, Security Second

Before you can run you have to walk.  With Claro Graphics we're trying to implement
the simplest GUI library that still provides you with the power you need to
get your job done.  While doing this we hope to include solid coding practices
and simple checks to keep the library safe and secure.  It's not possible
to get rid of all bugs, but we're damn sure going to try.

Some of our strategies are:

  • Heavily use asserts and debugging libraries to prevent bugs and bad usage.
  • Lots of well written documentation.  Can't screw it up if you know how to use it.
  • Unit testing galore.  Yes, you *can* do unit tests in C.
  • Consistent builds and automation for all platforms thanks to SCons.

We Love Scripting Languages

As mentioned before we plan to hook Claro Graphics into several scripting languages.
Scripting languages are notorious for having horrible GUI options.

We think that since Claro Graphics will be very small, very fast, use native components, and
be written in straight clear C, that it would be an excellent library for scripting langauges
to use for a basic GUI platform.


Extra Goodies (If You Like)

Claro Graphics is part of the "Claro":http://www.libclaro.org/ framework, which
provides some useful functions for people who need them in their applications.

We'll always make sure that you aren't forced to use anything you don't want.  The only
Claro component requirement for Claro Graphics is the claro.base library. Otherwise,
you'll never have to compile/distribute sockets/whatever to use graphics.
Title: Re: Claro-AIR
Post by: AIR on October 06, 2013, 09:34:38 pm
@AIR - No change on the Windows XP front with the new build of Claro.  :(

Try a simple window:

Code: [Select]
import claro

proc window_closed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  claro_shutdown()

var Form1 = newWindow( nil, new_bounds( 100, 100, 420, 330 ), 2 )
window_set_title( Form1, "Simple Window" )
object_addhandler( Form1, "destroy", window_closed )

window_show(Form1)
window_focus(Form1)

claro_loop()


If it still flashes, but doesn't crash, then I think the problem is in the claro_loop function, specifically the call to mssleep().

Code: Text
  1. * Run the Claro main loop */
  2. void claro_loop( )
  3. {
  4. claro_in_loop = 1;
  5.  
  6. while ( claro_in_loop )
  7. {
  8. claro_run( );
  9. #ifndef _NIX
  10. mssleep( 1 );
  11. #endif
  12. }
  13.  
  14. claro_destroy( );
  15. }

Code: Text
  1. void mssleep( int ms )
  2. {
  3. #ifdef _WIN32
  4. Sleep( ms );
  5. #else
  6. usleep( ms * 1000 );
  7. #endif
  8. }
Title: Re: Claro-AIR
Post by: John on October 06, 2013, 09:48:18 pm
I would have thought that the controls would have shown with my readLine(stdin) debugging statement in place. Is the code being generate for controls that don't exist (yet), maybe that's why the claro_loop() is crashing?

I tired your Simple Window example and it worked fine. (see attached)

Title: Re: Claro-AIR
Post by: AIR on October 06, 2013, 10:34:14 pm
Ok, start adding the stuff back in.  Start with the TextArea, then the Buttons (don't forget the buttonarray).

I have a sneaking suspicion, but want to see what happens first.
Title: Re: Claro-AIR
Post by: AIR on October 06, 2013, 11:05:06 pm
Some info regarding layouts:

Quote
    ‘[’ and ‘]’—Starts and ends a “row”. Rows have a default height, but you can put modifiers at the beginning to change it.
    ’|’—Separates cells inside a row. You can put any digits, uppercase, lowercase, or ’.’ chars between them to name cells. Cells don’t have to have names, which is common practice for “spacing” or empty cells.
    ‘<’ or ‘>’—Put anywhere in a cell indicates the cell should take the minimum width.
    ’_’—Put at the beginning of a row (like [_text] above) and that row will take up the remaining “unset” space. Also known as the “flex” operator, you can have as many flexed rows as you want and LEL will make them divide the remaining unset space between them.
Title: Re: Claro-AIR
Post by: John on October 06, 2013, 11:27:58 pm
I tried the buttons only first and that cause the exit. The text only version works fine.

Code: [Select]
import claro

var bTop:cint = 16
var text: ptr TTextArea

proc window_closed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  claro_shutdown()

var Form1 = newWindow( nil, new_bounds( 100, 100, 420, 330 ), 2 )
window_set_title( Form1, "Simple Window" )
object_addhandler( Form1, "destroy", window_closed )

text = newTextArea(Form1, new_bounds(bTop,bTop, 300,300), 0)

window_show(Form1)
window_focus(Form1)

claro_loop()
Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 04:39:12 am
Ok, I figured it was the buttons. 

Try adding them back in, but don't connect the button proc.

Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 08:19:23 am
Ok, the problem is not the buttons.  There's something weird happening on your end.

I was able to compile it under Win7 with no issues.
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 10:21:24 am
I will give it a try on my Win7 64 partition today. I would like to get Kent to be your Claro Windows guy and I'll do Linux.

This is really great news and a fine project you're saving.

Just read your PM. Thanks!

Title: Re: Claro-AIR
Post by: John on October 07, 2013, 11:17:56 am
(http://files.allbasic.info/Claro/air_ttt_winxp.png)

Works great and thanks for the new Windows Nimrod development environment. You should share this with Kent as well.

It is really cool to see focused efforts being turned into something worthwhile.

Is there anyway to get XP themes working?

FYI This forum has a code repository for members of this forum only. This would be a good place to put not ready for prime time code releases.
Title: Re: Claro-AIR
Post by: kryton9 on October 07, 2013, 01:15:26 pm
John, I am trying to join you guys in the linux world.
This really steamed me off at Microsoft:
http://www.zdnet.com/blog/hardware/microsoft-confirms-that-uefi-secure-boot-might-lock-out-linux-and-older-versions-of-windows-from-new-pcs/14942

I have been linux reading. I read an interview(2012) with Linus Torvalds where he mentions he uses Fedora and LXDE. I was going to try that next.

Report of my virtualbox vs vmware player tests:
Now I am running a very weak netbook, but I really like it. The Acer Aspire One 722, with a dual core AMD C60 APU (http://www.cpubenchmark.net/cpu.php?cpu=AMD+C-60+APU&id=244) and I maxed out the RAM at 4GB recently.

Both vmplayer and virtualbox are neat. I must say I liked virtualbox just a bit more. At least on my netbook, everything works really well and it does support 3D acceleration.
Just running Debian, it was fine, but when I compiled stuff, I could see how slow it was being in a VM.

I got wine to run and ran an opengl program written in oxgenbasic, amazing that it ran, but at half of acceptable framerates. Which was better than I expected on this netbook with debian running in a virtualbox, running wine, running opengl, pretty cool.

I am going to use virtualbox to choose a distro I like and to learn linux more. Then I will install the chosen Distro as a dual boot on the netbook. So I won't be coding much for a couple of days.

Title: Re: Claro-AIR
Post by: John on October 07, 2013, 01:30:32 pm
It's hard to get Kent dressed in the morning when he insists on running around naked.  :D
Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 01:44:58 pm
I'm not even gonna ask......
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 02:16:32 pm
Actually I admire someone that takes building their development environment seriously. It's like moving into a new house.

I just recompiled tt.nim and it works fine. I'm going to try and do a DLLC interface to Claro with SB.

Code: [Select]
F:\Claro-AIR\nimrod\projects\claro>nimrod c -D:release tt.nim
f:\claro-air\nimrod\config\nimrod.cfg(36, 2) Hint: added path: 'C:\Documents and Settings\John\.babel\pkgs\' [Path]
Hint: used config file 'F:\Claro-AIR\nimrod\config\nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: tt [Processing]
Hint: claro [Processing]
claro.nim(465, 2) Hint: 'noBoundsVar' is declared but not used [XDeclaredButNotUsed]
Hint: strutils [Processing]
Hint: parseutils [Processing]
tt.nim(15, 6) Hint: 'seed' is declared but not used [XDeclaredButNotUsed]
tt.nim(31, 6) Hint: 'val' is declared but not used [XDeclaredButNotUsed]
gcc.exe   -o f:\claro-air\nimrod\projects\claro\tt.exe  f:\claro-air\nimrod\projects\claro\nimcache\pure_parseutils.o f:\clar
o-air\nimrod\projects\claro\nimcache\pure_strutils.o f:\claro-air\nimrod\projects\claro\nimcache\claro_claro.o f:\claro-air\n
imrod\projects\claro\nimcache\nimrod_system.o f:\claro-air\nimrod\projects\claro\nimcache\claro_tt.o
Hint: operation successful (12169 lines compiled; 5.338 sec total; 8.819MB) [SuccessX]

F:\Claro-AIR\nimrod\projects\claro>

Title: Re: Claro-AIR
Post by: John on October 07, 2013, 04:28:04 pm
Is there a C style include for Claro I can build a DLLC interface from?

Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 04:38:55 pm
Have you looked inside the Claro "include" folder?  :P :P  ;D
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 04:46:07 pm
 :o  ??? ::)

Which one?

The claro.nim seems to be the best resource at the moment unless you can get me back on the C path with a consolidated .h
Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 04:48:15 pm
One thing's been bugging me about the Nimrod interface file to Claro.

With most GUI toolkits, you have the ability to assign an ID to an object, making it easier to code a single proc for all button actions, for example.  You just ask the sender (the button) to give you the ID you set, so you know which button is actually calling the proc at that time.

Claro doesn't seem to have that ability directly, and the Claro.nim file doesn't either.

At least not until now.

What I did was modify the TWidget type in the Claro.nim file, to add an "id" property:

Code: [Select]
  TWidget* {.pure.} = object of TClaroObj
    size_req*: ptr TBounds
    size*: TBounds
    size_ct*: TBounds
    supports_alpha*: cint
    size_flags*: cint
    flags*: cint
    visible*: cint
    notify_flags*: cint
    id*: int # added to provide alternate means of identifiying objects  <--HERE
    font*: TFont
    native*: pointer          # native widget
    ndata*: pointer           # additional native data
    container*: pointer       # native widget container (if not ->native)
    naddress*: array[0..3, pointer] # addressed for something
                                    # we override or need to remember

Up to now, I had been using the "naddress" property to store the button id, but the code to set and get the value was fugly and non-intuitive:

Code: [Select]
#SETTER
buttons[i].naddress[0] = cast[ptr int](i+1)

#GETTER
var multiplyer = cast[int](button.naddress[0])

Once I added the "id" property, I was able to modify the code to something a lot more clean and intuitive:
Code: [Select]
#SETTER
buttons[i].id = (i+1)

#GETTER
var multiplyer = button.id

Much cleaner and clear, right?

The other thing that was bothering me was this line:
Code: [Select]
buf &= IntToStr(multiplyer) & " x " & IntToStr(i) & " = " & IntToStr( multiplyer*i ) & "\n"
Nimrod has a cool shortcut (the Dollar Sign) that converts a number to a string.  So now it looks like this:
Code: [Select]
buf &= $multiplyer & " x " & $i & " = " & $( multiplyer*i ) & "\n"
More in line with a BASIC-Like approach, I think.  At least the overall code is cleaner now.  ;D

The best thing about being able to add an "id" property with Nimrod is that I didn't have to recompile the Claro library.  All I needed to do was modify the Claro.nim file with one simple addition, and change my own code to reflect that.

Very cool language, Nimrod.  Thanks John for finding it and sharing!


AIR.
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 04:58:41 pm
Quote
Very cool language, Nimrod.  Thanks John for finding it and sharing!

Sorry, the honor goes to Kent. (see first post) I was impressed with it as soon as he posted the link. It's not hard selling someone on the Nimrod concept because the language is based on all the other cool stuff in other languages and rebaked.
Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 05:03:23 pm
:o  ??? ::)

Which one?

The claro.nim seems to be the best resource at the moment unless you can get me back on the C path with a consolidated .h

base.h for the basic runtime functions
graphics.h for the widgets

Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 05:04:24 pm
Quote
Very cool language, Nimrod.  Thanks John for finding it and sharing!

Sorry, the honor goes to Kent. (see first post) I was impressed with it as soon as he posted the link. It's not hard selling someone on the Nimrod concept because the language is based on all the other cool stuff in other languages and rebaked.

Thanks, Kent!  This is a very cool find!

AIR.
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 05:11:34 pm
Quote
base.h for the basic runtime functions
graphics.h for the widgets

Funny AIR.

Two .h files pointing to dozens of others.

Title: Re: Claro-AIR
Post by: AIR on October 07, 2013, 05:31:50 pm
Concentrate on the "widgets" folder. And also "widgets.h" for common widget functions.

Put it together slowly, start with windows.h and widgets.h
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 06:00:50 pm
I think the approach I'm going to take is use the claro.nim as my guide and reference the C .h files if I don't understand the Nimrod conversion syntax.

Thanks for the hints.

Title: Re: Claro-AIR
Post by: John on October 07, 2013, 06:13:32 pm
In Spanish, Claro means 'Of Course' or 'Obviously'.
Title: Re: Claro-AIR
Post by: John on October 07, 2013, 06:57:23 pm
Quote
Look in the interface/python folder for an idea of what you might need to wrap.

It doesn't look like there are many functions that make up the Claro API. Comparing it to IUP core form functionality, where does Claro stand?