[pygtk] gobject.signal_list_names: incompehensions

Johan Dahlin jdahlin at async.com.br
Fri Mar 24 03:49:38 WST 2006


Sandro Dentella wrote:
> Hi all, I'm a beginner in the GTK world, and I don't really understand
> signals. I'd like to connect a click on an EventBox, but
> 
>   my_event_box.connect('button_press', pressed)

It's called 'button-press-event'

dashes(-) and underscores(_) are the same thing in signals but dashes are
normally prefered.

> So I tried to use gobject.signal_list_names to get a list of the signals
> admitted but I get a o-lenght list.
> 
> I further tried gobject.signal_list_names(gtk.Entry) and I got:
> ('activate', 'move-cursor', 'copy-clipboard', 'populate-popup',
> 'insert-at-cursor', 'delete-from-cursor', 'backspace', 'cut-clipboard',
> 'paste-clipboard', 'toggle-overwrite')

signal_list_names only list signals for the current type and not the parent
types. In this case you should have looked at gtk.Widget where
button-press-event is defined

-- 
Johan Dahlin <jdahlin at async.com.br>
Async Open Source


More information about the pygtk mailing list