Re: [gtk-list] Re: XmUpdateDisplay equivalent?




On Tue, 2 Jun 1998, Michael J. Hammel wrote:

> In a previous message, robert havoc pennington says:
> > would this work?
> > 
> > while ( gtk_events_pending() ) {
> >   gtk_main_iteration();
> > }
> 
> It seems like it should, but didn't.  I only got the shell window
> displayed.  The contents of the window were not drawn.  I ended up changing
> the logic of my program so that the dialog that I wanted to open would
> cause the long winded callback to start when a button was pressed.  Before
> I was popping up the window (which was generally information only) and
> starting the long callback right after.  The new logic makes better sense
> anyway - and actually works better from an end user standpoint.

The thing is that your code has to wait for the window
to show up; just processing all idle events won't help
since GTK is waiting for a response from the X server.

The function you want is

 gtk_widget_[window?]_show_now()

It should work to do:

 gtk_widget_show_now(some_toplevel_window)
 gtk_widget_draw (some_toplevel_window)

I forget if the draw is actually necessary.

Regards,
                                   Owen



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