[maemo-developers] [maemo-developers] g_signal_connect and "show" signal not working in hildon applications (Maemo 1.1)?

From: Lassi Syrjälä lassis at cc.jyu.fi
Date: Mon Jan 16 23:33:37 EET 2006
Luca Donaggio kirjoitti 16.1.2006 kello 17.09:

> It seems that the following doesn't work:
>
> [code]
>
> g_signal_connect (G_OBJECT (main), "show",
>                     G_CALLBACK (on_main_create),
>                     NULL);
>
>
> [/end code]

Hi,

I'd assume it works, but only if you connect the handler before  
showing the widget. "Show" is anyway not the most useful of signals,  
since it's synchronously and only ever emitted when you  
gtk_widget_show (main). In this case, it probably gains you nothing,  
since you could as well write:

gtk_widget_show (main);
on_main_create (main, NULL);

Instead, you could try something like:

g_signal_connect_after (main, "map", G_CALLBACK (on_main_create), NULL);

If that does not do the trick, adding a low priority idle function  
with a return value of FALSE might help.

BR,
Lassi


More information about the maemo-developers mailing list