Re: [gtk-list] Re: how do i force a window to be fully realized ?



>You call gtk_widget_realize() right? If not, the widget won't be realized
>until its toplevel is realized. If you do call it, the widget must be 
>a child of a toplevel or it won't work since a force-realize entails
>realizing a widget's parent.

the top level widget is already realized (always). i call
gtk_widget_show_all (), which i believe is close to the same thing as
gtk_widget_realize(). or is it not ? i have my doubts ...

the wierd thing is that it works about 80% of the time ...

>A much nicer way is to connect a signal handler to the "realize" signal
>(or if you need the window to be ready for drawing, the first "expose"
>signal), and then wait in a recursive gtk_main() until your signal handler
>is called. See gnome_dialog_run() for an example of how this works.
>
>This is assuming you need the function to block waiting for the widget to
>be realized, if you can afford to return then just connect to "realize".

looking into it as i write ...

--thanks
--p



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