Re: Waiting for multiple windows



Hi Jonathon,

Jonathon Jongsma wrote:
On 8/29/07, Edd Dawson <lists mr-edd co uk> wrote:
I'm writing a system where requests are coming in asyncronously (through a
socket, typically) and a new window is created to handle each request.

To do this, I have a "main" window that shows the active connections and its
class has a member function that pops up a new window to handle each request.
These pop-up windows should not block input to any other window (i.e. they
should not be modal).

Currently, when I close the main window, all the pop-ups dissappear because the
event loop has finished. Is there any way to keep the initial call to
Gtk::Main::Run() from finishing until all the popups have been closed?

If your main window knows whether there are any popup windows still
open, you can override on_delete_event () [1] (which is called when
the user clicks the window manager close button) and if there are any
popups still open, return false (or is it true? I never remember) to
not allow the main window to be destroyed.  Does that help?

[1] http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Widget.html#a97a4453ec12f7fce163353c2bcaf580

Perfect! Thanks very much for your help!

Edd



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