On Windows, there's DllMain for dynamic link libraries that will be
invoked automatically if present, by the OS. If there is an equivalent
mechanism on Linux, it might be nicer to initialize GTK there, instead
of using a manual call?
Cheers,
Edwin
(more info on DllMain here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecoreos5/html/wce50lrfDllMain.asp)
)
daniel fischer wrote:
hey guys,
i've started porting neko-systools to GTK for linux (and other OSs). In contrast to
win/mac desktops, GTK has to be initialized once (gtk_init). I'm proposing an
initialization method in the "misc" module, and a static variable in api.c a la:
> static int _systools_is_initialized = 0;
> static value misc_initialize() {
> if( _systools_is_initialized==0 ) {
> systools_misc_initialize();
> _systools_is_initialized = 1;
> }
> return val_null;
> }
> DEFINE_PRIM(misc_initialize,0);
any systools class requiring initialization would get an __init__ method like:
> private static function __init__() : Void {
> Misc.initialize();
> }
windows and mac's sytools_misc_initialize() would be an empty stub. is that a
proper way to do this? any thoughts about it? if ok, i'd check this into svn.
-dan
--
Neko : One VM to run them all
(http://nekovm.org)