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

Check this out (from the docs) :


Nickolai Dobrynin wrote:

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?


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.


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();*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.

don't see any easy way how
it's written here, seeing as the main function blocks on Thanks!
Murray Cumming
murrayc murrayc com

gtkmm-list mailing list
gtkmm-list gnome org

gtkmm-list mailing list
gtkmm-list gnome org
gtkmm-list mailing list
gtkmm-list gnome org

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