More than one event loop? (Was: "How to show new window?")



Are you actually supposed to or even allowed to create more than one
event loop within the same program?  Gtk::Main is a singleton, is it not?

Even if it is indeed possible, why would it be advantageous to do it
this way rather than simply keeping the pointers around and accessing them
as necessary?


Nickolai



On Wed, Oct 19, 2005 at 09:02:33AM -0500, Bob Caryl wrote:
> Depending on how you wish your new window to behave (modally or not), 
> you can use Murray's suggestion, or you can, within the callback slot 
> for the "widgets in the original window", instantiate your new window 
> class and then use Gtk::Main::run to set up a separate event loop for 
> your window that would terminate when your new window is hidden.
> 
> Bob
> 
> Murray Cumming wrote:
> 
> >>I have a question that I can't seem to find an answer to on google.
> >>
> >>I have a program that uses a single window. Using glademm, gtkmm, etc, it
> >>generated the
> >>following code for my Main function:
> >>
> >>Gtk::Main m(&argc, &argv);
> >>
> >>winOscilloscope *winOscilloscope = new class winOscilloscope();
> >>m.run(*winOscilloscope);
> >>delete winOscilloscope;
> >>return 0;
> >>
> >>This works well, but now I want to add another window to the program.
> >>Specifically, I want to make
> >>a configuration dialog that I can open and close, controlled by widgets in
> >>the original window. What
> >>is the correct way to add this into a program that is built with glade?
> >>   
> >>
> >
> >You are using glademm-generated source. glademm has a separate mailing
> >list. Here I will always recommend use of libglademm instead.
> >
> >With libglademm you would get the window and show() it, optionally
> >deriving a window class.
> >
> > 
> >
> >>I
> >>don't see any easy way how
> >>it's written here, seeing as the main function blocks on m.run. Thanks!
> >>   
> >>
> >
> >
> >Murray Cumming
> >murrayc murrayc com
> >www.murrayc.com
> >www.openismus.com
> >
> >_______________________________________________
> >gtkmm-list mailing list
> >gtkmm-list gnome org
> >http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >
> > 
> >
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



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