gtk_module_init, *argc is 0!



hi all,

i'm currently makeing a gtk module, and wanted to parse arguments in
gtk_module_init, but there are no arguments!
so i had a look in gtkmain.c.
if module has no display init function, gtk_module_init is called in
line 589

...
info->init_func (&gtk_argc, &gtk_argv);
...

and gtk_argc
in line 141
...
static gint    gtk_argc = 0;
...

in line 777  
...
gtk_argv = g_malloc ((gtk_argc + 1) * sizeof (char*));
for (i = 0; i < gtk_argc; i++)
	gtk_argv[i] = g_strdup ((*argv)[i]);
gtk_argv[gtk_argc] = NULL;
...

i think the problem is, that gtk_argc is still 0, so nothing is copied??
gtk_argc = *argc before gtk_argv = g_malloc ((gtk_argc + 1) * sizeof
(char*)); should help??!!

any comments?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]