[ruby-gnome2-doc-cvs] [Hiki] update - tut-gtk-events

アーカイブの一覧に戻る

ruby-****@sourc***** ruby-****@sourc*****
2004年 4月 3日 (土) 07:26:16 JST


-------------------------
REMOTE_ADDR = 200.216.151.125
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/en/?tut-gtk-events
-------------------------
- {{link "tut-gtk-signals", "tut-gtk-intro", "tut-gtk", "tut-gtk-helloworld-details"}}
  = Events
+ {{link "tut-gtk-signals", "tut-gtk-intro", "tut-gtk", "tut-gtk-helloworld-details"}}
  
  In addition to the above signal mechanism, events from the X Window Server are also reflected in GTK.
  
  Here is an exhaustive list of catchable events:
  
  * event
  * button_press_event
  * button_release_event
  * scroll_event
  * motion_notify_event
  * delete_event
  * destroy_event
  * expose_event
  * key_press_event
  * key_release_event
  * enter_notify_event
  * leave_notify_event
  * configure_event
  * focus_in_event
  * focus_out_event
  * map_event
  * unmap_event
  * property_notify_event
  * selection_clear_event
  * selection_request_event
  * selection_notify_event
  * proximity_in_event
  * proximity_out_event
  * visibility_notify_event
  * client_event
  * no_expose_event
  * window_state_event
  
  You can connect some code to a specific X11 event exactly in the same way as we saw previously with 
  GTK signals.  Just provide one of the above mentioned "event name" instead of "signal name":
  
    GLib::Instantiatable#signal_connect("event name") do
        # Code to execute upon reception of "event name".
    end
  
  The callback code can accept 2 parameters, as follows:
  
    GLib::Instantiatable#signal_connect("event name") do |w, e|
        # ...
    end
  
  (in this case, w will refer the widget, and e the event).
  
  Depending of the return value of the block code, GTK will decide if the event should be spread or not:
  
  * if true, GTK will stop the event processing here;
  * if false, GTK will continue to propagate the event [xxx explain more]
  
  Also, GDK selections and drag-and-drop issue several events, but these are reflected by GTK signals:
  
  * selection_received
  * selection_get
  * drag_begin_event
  * drag_end_event
  * drag_data_delete
  * drag_motion
  * drag_drop
  * drag_data_get
  * drag_data_received





ruby-gnome2-cvs メーリングリストの案内
アーカイブの一覧に戻る