Re: [gtk-list] Dialog on startup



On Sat, 19 Jun 1999, Ron Forrester wrote:

> 
> When my app (gamestalker) starts up, I am checking on a server (via
> sockets) somewhere to see if there is a newer version available, and
> if so I would like to popup a dialog notifying the user.
> 
> Is there some way before I call gtk_main(), I can queue up a message
> (signal?) such that once gtk_main() is called, the signal will fire
> and I can popup this dialog box?

you can use gtk_init_add() to have functions executed right at
gtk_main() startup. but from what you said i think you rather
want something like (pseudo code):

app = create_main_application_window ();

if (new_version_available ())
  {
    tmp_dialog = create_tmp_dialog ();
    gtk_signal_connect_object (GTK_OBEJCT (tmp_dialog),
                               "destroy",
                               gtk_widget_show,
                               GTK_OBJECT (app));
   /* this callback could also be hooked up to an OK button or something */
   gtk_widget_show (tmp_dialog);
 }
else
  gtk_widget_show (app);

gtk_main ();


> 
> tia
> rev&
> 

---
ciaoTJ



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