Re: Newbie Question - reg display of windows in an App



I think you want a "wizard". The Gtk::Assistant does this:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1Assistant.html

I try to achieve similar behavior now.
I write a client-server game application.
The first dialog of client displays list of games when user clicks
"Join" this dialog disappears and game window is open.
To implement that I have something like the following code:

============================
class GameWnd : public Gtk::Dialog{
...
};
class ServerState : public Gtk::Dialog{
....
void on_button_join(){
   this->hide();
   GameWnd* w=new GameWnd;
   Gtk::Main::run(*w);
   this->show();
}
};


int main(){

...
 ServerState* s=new ServerState;
 Gtk::Main::run(*s);
...

};
==============================

I have the following problem:
When user closes GameWnd, the Main::run(...) method returns control to
the on_button_join and ServerState dialog gets shown again.
But after that the outermost Main::run(*s) terminates anyway.
(I have to hide "parent" dialog to forbid button clicks in it)

The other implementation I tried - is doing all the same but call
Dialog::run() instead of
Gtk::Main::run() and remove all the hide/show code.
This gives the needed behavior, but all dialogs under win32 are always
drawn on top of any other windows and cannot be minimized.

So what's the best solution to these problems?

--
WBR, Pavlo Korzhyk
ICQ#155870780



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