Gtk2::Dialog docs on delete-event
- From: Kevin Ryde <user42 zip com au>
- To: gtk-perl-list gnome org
- Subject: Gtk2::Dialog docs on delete-event
- Date: Tue, 20 Nov 2007 10:59:25 +1100
I think a typo from the Gtk reference manual has propagated into the
Gtk2::Dialog docs. Where it says
If a dialog receives a delete event, the "response" signal will be
emitted with a response ID of 'GTK_RESPONSE_NONE'
I believe it's actually GTK_RESPONSE_DELETE_EVENT (simple program below,
hit the window manager delete button).
The GtkDialog docs say NONE under the response signal description, but I
think it ought to be DELETE_EVENT as per earlier in the same page. I'm
also fairly sure there's no difference for the response under
gtk_dialog_run, though I've never used that.
use Gtk2 '-init';
my $dialog = Gtk2::Dialog->new ('Foo', undef, []);
$dialog->signal_connect (response => sub { print @_, "\n" });
$dialog->show_all;
Gtk2->main;
--- GtkDialog.xs 19 Sep 2005 01:07:22 +1000 1.28
+++ GtkDialog.xs 19 Nov 2007 19:17:55 +1100
@@ -159,8 +159,7 @@
GTK+ will never assign a meaning to positive response IDs; these are entirely
user-defined. But for convenience, you can use the response IDs in the
Gtk2::ResponseType enumeration. If a dialog receives a delete event, the
-"response" signal will be emitted with a response ID of 'GTK_RESPONSE_NONE'
-(except within C<run> -- see below).
+"response" signal will be emitted with a response ID of 'delete-event'.
If you want to block waiting for a dialog to return before returning control
flow to your code, you can call C<< $dialog->run >>. This function enters a
@@ -330,7 +329,7 @@
During C<run>, the default behavior of "delete_event" is disabled; if the
dialog receives "delete_event", it will not be destroyed as windows usually
-are, and C<run> will return 'GTK_RESPONSE_DELETE_EVENT' ('delete-event').
+are, and C<run> will return 'delete-event'.
Also, during C<run> the dialog will be modal. You can force C<run> to return
at any time by calling C<< $dialog->response >> to emit the "response" signal.
Destroying the dialog during C<run> is a very bad idea, because your post-run
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]