Re: timer function



Louis Lu wrote:

> Hi All:
>
>    If I want to pop up a message in a dialog, and would like the dialog will be closed either by click "OK" or after 5
> second.  is there someone who know how to set a timer in the program.  Appreciate your help.
>
> Best regard
> Louis
> ___________________________________________________________________________
> Visit http://www.visto.com.
> Find out  how companies are linking mobile users to the
> enterprise with Visto.
>
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list

 Here is the theory on how to do it. I am too lazy to come up with the actual code for you but I will do so if you
can't implement  the theory.

Create a timer passing it the address of a function to call 5 seconds or whatever after your dialog has been displayed.
Once called,  have the function call gtk_signal_emit_by_name() to cause your handler for the dialog's OK button to run.
Naturally your handler will just close the dialog window!

Hint: calling gtk_signal_emit_by_name() has the same effect as actually clicking on the button.

Good luck.





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