perl-Gtk2 r2104 - in branches/stable-1-20: . xs



Author: tsch
Date: Thu Jan  1 21:42:06 2009
New Revision: 2104
URL: http://svn.gnome.org/viewvc/perl-Gtk2?rev=2104&view=rev

Log:
Merge r2103 from trunk.


Modified:
   branches/stable-1-20/   (props changed)
   branches/stable-1-20/ChangeLog
   branches/stable-1-20/xs/Gtk2.xs
   branches/stable-1-20/xs/GtkWindow.xs

Modified: branches/stable-1-20/xs/Gtk2.xs
==============================================================================
--- branches/stable-1-20/xs/Gtk2.xs	(original)
+++ branches/stable-1-20/xs/Gtk2.xs	Thu Jan  1 21:42:06 2009
@@ -520,16 +520,20 @@
 
  ##guint gtk_key_snooper_install (GtkKeySnoopFunc snooper, gpointer func_data);
 =for apidoc
-=for arg snooper (subroutine) function to call on every event, must return a boolean
-Install a key "snooper" function, which will get called on all key events
-before those events are delivered normally.  These snoopers can be used to
-implement custom key event handling.  I<snooper> will receive the widget to
-which the event will be delivered and the event, and also I<func_data> (if
-provided).  If I<snooper> returns true, the event propagation will stop
-(just like normal event handlers).
+=for arg snooper (subroutine) function to call on every event
+Install a key "snooper" function which will get called on all key
+events before those events are delivered normally.  These snoopers can
+be used to implement custom key event handling.
 
 C<key_snooper_install> returns an id that may be used with
-C<key_snooper_remove>.
+C<key_snooper_remove> (below).  I<snooper> is called as
+
+    stopbool = &snooper ($widget, $event, $func_data);
+
+It should return true to stop event propagation, the same as
+C<Gtk2::Widget> event signal handlers.  The C<Gtk2::EVENT_STOP> and
+C<Gtk2::EVENT_PROPAGATE> constants can be used for the return (see
+L<Gtk2::Widget>).
 =cut
 guint gtk_key_snooper_install (class, SV * snooper, SV * func_data=NULL)
     CODE:

Modified: branches/stable-1-20/xs/GtkWindow.xs
==============================================================================
--- branches/stable-1-20/xs/GtkWindow.xs	(original)
+++ branches/stable-1-20/xs/GtkWindow.xs	Thu Jan  1 21:42:06 2009
@@ -48,9 +48,10 @@
     $toplevel->signal_connect (delete_event => sub {
        if (any_unsaved_documents()) {
          popup_ask_save_before_exit_dialog();
-         return 1;  # don't propagate to default destroy
+         return Gtk2::EVENT_STOP;  # don't go to default destroy
+       } else {
+         return Gtk2::EVENT_PROPAGATE;
        }
-       return 0;  # do propagate
     });
 
 In a dialog or secondary app window you might not want to destroy but



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