Re: Opening and closing a toplevel
| From: | James Cameron | Date: | Fri, 22 Nov 2002 02:11:19 +0000 |
| Subject: | Re: Opening and closing a toplevel | ||
| References: | 1 2 3 4 5 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-2698@lists.php.net to get a copy of this message | ||
On Fri, Nov 22, 2002 at 01:32:50AM +0100, erbel@submedia.de wrote:
> Yes, I think so:
> $w2->connect('delete_event','killwin2');
You didn't show me exactly what killwin2 does.
What does it return?
> The killwin2-Function just should do $w2->hide(); to hide the window.
> How can we stop users from exiting the application by clicking the X
> oder double-clicking on the left edge?
By returning true from the 'delete_event' function.
Or, try using a popup window instead of a toplevel window.
The manual for GtkWindow says: (my old cached copy)
<quote>
Toplevel windows contain the standard window decorations minimize, maximize and close. Of these, the
first two exhibit the expected default behaviour; this is pre-set within the GDK source, and cannot
currently be altered from within PHP-GTK. The close button is not pre-set in same way, in that its
emission of the destroy signal can be overridden by connecting a function to the window's
delete-event signal and having that function return true. Note that the main window's destroy
signal should be connected, directly or otherwise, to a function that will quit the GTK main loop.
A dialog window is not the same thing as a GtkDialog, but is simply a normal toplevel window with
the maximize function disabled. Both dialog and popup windows are designed to be used when a message
to the user requires a response, and should be used in conjunction with the set_transient_for() and
set_modal() methods.
A popup window lacks any window decoration, so needs an alternative means of closure. This could
triggered by a timer, an event, or a widget capable of user interaction.
</quote>
--
James Cameron mailto:quozl@us.netrek.org http://quozl.netrek.org/