Re: keep window above other
| From: | Adz07 | Date: | Sun, 27 May 2007 17:46:10 +0000 |
| Subject: | Re: keep window above other | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7881@lists.php.net to get a copy of this message | ||
Ok,
I have done this and it works to an extent but not exactly how i was
hoping. The main window is kept behind the smaller one but can still be
minimized or moved while the small window is open. I want to make sure that
the main window is not usable when the smaller on is visible. Here is my
code for a test:
<?php
//create a main window
$wnd = new GtkWindow();
$wnd->set_title('Hello world');
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->set_default_size(600,600);
$wnd->set_position(GTK_WIN_POS_CENTER);
$lblHello = new GtkLabel("Just wanted to say\r\n'Hello world!'");
$wnd->add($lblHello);
$wnd->show_all();
$wnd->set_accept_focus(false);
//create the child window
$wnd_s = new GtkWindow();
$wnd_s->set_title('Hello world 2');
$wnd_s->set_default_size(200,400);
$wnd_s->set_position(Gtk::WIN_POS_CENTER_ON_PARENT);
$wnd_s->set_transient_for($wnd);
$wnd_s->set_modal(true);
$wnd_s->show_all();
Gtk::main();
?>
Any ideas??
bob majdak jr wrote:
>
> on the small window:
>
> set_transient_for(parent)
> set_modal(true)
>
> that should prevent the big window from doing anything while the little
> window is up - but that depends on if your window manager honours those
> things. the small window should probably even follow the big one if it
> was moved. i would probably recommend:
>
> set_position(Gtk::WIN_POS_CENTER_ON_PARENT)
>
> on the small window too.
>
> - bob.
>
>
>
> Adz07 wrote:
>> If i load a large indow and small window at the start up of an app is it
>> possible to keep the small window infront of the larger one and not allow
>> focus on the big one untill the small one is closed??
>>
>> The only way i can see is to set the small window to set keep above, but
>> this isn't really what i am after.
>
> --
> PHP-GTK General Mailing List (http://gtk.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--
View this message in context: http://www.nabble.com/keep-window-above-other-tf3822470.html#a10826870
Sent from the Php - GTK - General mailing list archive at Nabble.com.