Re: realize callback issues



Clancy, Shane W. wrote:

all,
i have a gnome application that uses a number of different event callbacks,
and for some reason my gtk_widget_realize callbacks are not working.  here's
a short description:
**********
void
create big_widget()
{
 <make the widget>
gtk_signal_connect (GTK_OBJECT (big_widget), "realize",
                     GTK_SIGNAL_FUNC (on_big_widget_realize),
                     NULL);
gtk_widget_show_all (big_widget);

 return 0;
}

void
on_big_widget_realize()
{
 printf("big_widget_realize function called.\n");
}
***********
if i call a simple function before the return statement, it works.  all my
other callbacks work.  the realize callbacks are the only ones i'm having
issues with.  it was my understanding that when you show a widget,
gtk_widget_realize() is called for you.  i even tried calling
gtk_widget_realize() directly after the widget was shown, but it still
didn't activate my callback.  i would imagine i'm doing something wrong, but
have no idea what it could be.
any help would be appreciated.
Your widget won't usually be realized until it is (a) shown, and (b) its parent gets realized. So by induction, the widget must be packed inside its parent, and its parent in the grandparent, all the way up to the toplevel, and all the ancestors must be shown. Does this help?

James.

--
Email: james daa com au              | Linux.conf.au   http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.






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