[haXe] exe to neko call
Lee McColl Sylvester
lee at designrealm.co.uk
Wed Feb 21 17:48:11 CET 2007
Okay, so the static variable declaration will exist in the stub exe, and
I put the set_hide_window function in an ndll, right? Or do I put it
also in the exe? If in the exe, how do I access the function?
Thanks,
Lee
Nicolas Cannasse wrote:
>> Sorry, theres a lot of crap in there. Try
>>
>> void TaskBar::OnMenuRestore(wxCommandEvent& )
>> {
>> value mload = neko_default_loader(NULL, 0);
>> val_call0(val_field(mload,val_id("hideWindow")));
>> }
>
> neko_default_loader allocate a new loader which does not have a
> hideWindow method. And it's not easy to retreive the current loader
> (since you are outside of a Neko module it would not make sense).
>
> Try setting a callback first, store it into a alloc_root(1) block, and
> use it :
>
> static value *hwindow = NULL;
>
> value set_hide_window( value v ) {
> val_check_function(v,0);
> if( hwindow == NULL ) hwindow = alloc_root(1);
> *hwindow = v;
> return val_null;
> }
>
> ...
>
> if( hwindow != NULL )
> val_call0(*hwindow);
>
> Nicolas
>
More information about the Haxe
mailing list