Re: Some new to gtkmm questions



John Taber wrote:
On Thursday 17 March 2005 23:11, Timothy M. Shead wrote:
2) splash screen - I have a splashscreen class that runs fine by itself
but how do I specify it in "main.cpp"  so that after it disappears, main
runs the main layout dialog.  my main now looks like:
int main(....)
Gtk::Main kit(...)
SplashDialog *splash = new SplashDialog();
splash->show();
delete splash;
MainDialog mainDlg;
Gtk::Main::run(mainDlg);
You are deleting your splash as soon as it is created, it never becomes
visible because there is no event loop running to make it visible.  You
probably want to call

splash->run();

with this the splashscreen never appears - do I somehow need to set it
modal ?

I understand what you mean about deleting immediately but run is not a method of splash (which is derived from Gtk::Window) - I also tried using Gtk::main::run() which runs the splash okay but then doesn't seem to run main dialog - my guess is that I need to set splash to be a modal dialog - that would hold it before deleting - but not sure how to do it.
John
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list

HeyJohn,

If you have something set up to hide the splash window (like a timer event) at some point, then I think the following code should work:

SplashDialog *splash = new SplashDialog();
Gtk::Main::run(*splash);
delete splash;
MainDialog mainDlg;
Gtk::Main::run(mainDlg);

Best regards,
Bob Caryl



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