ruby-****@sourc*****
ruby-****@sourc*****
2003年 10月 20日 (月) 19:46:00 JST
------------------------- REMOTE_ADDR = 62.10.96.29 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/it?tut-gtk-events ------------------------- - = Eventi + = Events - In aggiunta al meccanismo di segnali sopra, gli eventi dal X Window Server rispecchiano anche quelli in GTK. + In addition to the above signal mechanism, events from the X Window Server are also reflected in GTK. - Sotto una lista completa degli eventi intercettati: + 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 - Si pucollegare del codice a uno specifico evento X11 esattamente nello stesso modo come si visto con i segnali GTK; basta fornire un "nome evento" visto sopra, invece di "nome segnale": + 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 - # Codice da eseguire per la ricezione di "nome evento". + # Code to execute upon reception of "event name". end - Il codice callback puaccettare 2 parametri, come i seguenti: + The callback code can accept 2 parameters, as follows: GLib::Instantiatable#signal_connect("event name") do |w, e| # ... end - (in questo caso, 'w' si riferisce al widget e 'e' all'evento). + (in this case, w will refer the widget, and e the event). - In base al valore restituito dal codice blocco, GTK deciderse l'evento dovrpropagarsi o no: + Depending of the return value of the block code, GTK will decide if the event should be spread or not: - * se vero, GTK fermerl'esecuzione dell'evento; - * se falso, GTK continuera propagare l'evento [xxx significa pi + * if true, GTK will stop the event processing here; + * if false, GTK will continue to propagate the event [xxx explain more] - Anche le selezioni GDK e molti eventi drag-and-drop, ma questi sono riferiti ai segnali GTK: + 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