Re: gtk_widget_show() doesn't "show".



On Thu, 30 Nov 2000, James K. Wiggs wrote:

> On Thu, 30 Nov 2000, Joshua Horvath wrote:
> 
> > If you're creating all this stuff in a single function, I believe all the
> > "show" events just get queued until you return to the main gtk loop.  So to
> > have things appear as you create them I think you'd have to do something like
> > 
> > [create_notebook_page]
> > 
> > gtk_widget_show(page);
> > 
> > while (gtk_events_pending())
> > 	gtk_main_iteration();
> > 
> > and so on...
> 
>    Bingo!  That was it.  I had thought something along these lines, and
> even inserted a call to gtk_main_iteration(), but only *one* call, which
> was obviously not enough.  I put in that loop, and the problem goes away.

Alternatively, you can use the gtk_widget_show_now() function, which will
make sure the widget is drawn.  Note however, that if you aren't giving
any time to the main loop other than this, your windows won't redraw when
covered and exposed.

James.





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