Re: How do I show window for for just a few seconds(see code)

>> window for 5 seconds.  I suppose I want to allow "main" to run for 5=20
>> seconds and then call "gtk_widget_destroy(window)" but I'm not sure how t=
>> go about it.  Any ideas?
>use alarm to send a SIGALARM  to the program and call gtk_widget_destroy
>or gtk_main_quit from the signal handler.

horrible idea. signal handlers are asynchronous with respect to the
event loop, unless you understand how to use glib in ways that i
strongly suspect the questioner does not.

use gtk_timeout_add() to add a callback that will be called in some
number of milliseconds. have the callback hide the window and return
FALSE indicating it does not need to be called again.


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