Hi Nicholas

First, neko is awesome, i'm finding the FFI very intuitive to use.
Thanks for such great software.

I'm attempting to wrap Gtk in neko for use in haxe and so far it's
going quite well, but my first question is

value labelSetText(value w,value l) {
        val_check_kind(w,k_label);
        val_check(l,string);
        gtk_label_set_text(GTK_LABEL(val_data(w)),val_string(l));
        return val_true;
}

when I dereference val_string(l) do i get a copy of the string or is it
still garbage collected? I don't want to be passing a garbage collected
string to Gtk, so should I strdup(val_string(l)) ?

And I've come across a bizarre problem with the function above, I call
it with

        private function setLabel(l:String) { _setLabel(_object,l);
return l; }

and define it with 

        static var _setLabel = neko.Lib.load("test","labelSetText",2);

now all the other functions I've wrapped require _setX(_object,untyped
l.__s) but this one fails with the following error

       Uncaught exception - Invalid field access : __s

but it does work fine as defined above. So the bizarreness is
inconsistency.

Thx

bd


-- 
"It is no measure of health to be well adjusted to a profoundly sick
society." --Jiddu Krishnamurti

-- 
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to