Modal window



Hi,

I need to show a modal window where you select some options.
First i tried to use Gtk::Dialog, but it is quite restrictive, so i implement my own modal window, it extends Gtk::Window the run method is just:
void Mywin::run(void) {
       items[0]->grab_focus();
       Gtk::Main::run(*this);
}
It' seems to work fine, but i cannot get the window to have focus, i added a button that haides the modal window:
void Mywin::onItemClick(int cod) {
       /* do something */
       hide();
}
I have to click twice, the first click does nothing, the second click behaves like expected.

The modal window is shown from another window like this:
void TestWindow::onOptionsClick(void) {
       Mywin win(...);

       ...

       win.show();
       win.run();
}

Ideas?

Regards,
Diego A. Fons.



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