Re: question about gtk_events_pending() and gtk_main_iteration()



Hi,

"Sergey I. Kuzminov" <ksi sparc spb su> writes:

> I have one question about loop:
> 
> while (gtk_events_pending())
>     gtk_main_iteration();
> 
> 
> Documenation says what gtk_events_pending() method can be used to update the
> GUI.
> 
> I want to see toplevel window with my widget (for example, GtkSpinButton).
> If I invoke g_usleep (1) during the loop I can see correct shown window and
> button.
> But if I comment this string, usually I can't see button.

you shouldn't call gtk_main_iteration() at all. Simply replace the loop
with a call to gtk_main() to start the GTK+ event loop. Have a look at

 http://gtk.org/tutorial/ch-gettingstarted.html#SEC-HELLOWORLD

to see how you can set up your main application window so the main loop
is stopped when the window gets destroyed.


Salut, Sven



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