[gtkmm] Spawning a new windows from toplevel window



Hello everybody

I write program for analizing ECG signals (viewer, R peak detector, PVC detector, ...). I wrote everything in C++ and designed GUI in GTKmm. Main window of my aplication is represented by EcgMain class (public Gtk::Window(TOPLEVEL)). It's responsible for making general operations on signal records (opening, saving,...). So I have method
EcgMain::on_open_file() which is responsible for opening new signal
record and spawning new window with record (class SignalWindow : public
Gtk::Window as well).
	To spawn a new toplevel signal window in on_open_file() i used
Gtk::Main:run(m_signal_window_object). Simple code doing this looks in
my program as follows:

... // finding signal record and loading to memory

SignalWindow m_signal_window(pointer_to_signal_record) ; // new window
Gtk::Main:run(m_signal_window); // launch new window

The problem is of course when I open a few signal windows and want to close one of them. In SignalWindow class I have overriden
on_delete_event() method. When I want to close single signal window
there is Gtk::Main::quit() call inside on_delete_event(). Window is
closed of course but not this one which I wanted to close, but this
which was last launched by Gtk::Main:run. My question is quite simple.
How can I spawn new window from main one without calling Gtk::Main::run
or how can I close single window (this one which I want to close, not
the last opened) ??

Thanks in advance for any help

	static_cast<Desperated>(RedBull)




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