Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread saeed
Tim Evans: But it doesn't work for me! The "button" receives neither "button-press-event" or "pressed" or "clicked". I receives only an expose-event when resizing column. def show_event(widget, event): print type(widget), event.type.value_name button.connect('event', show_event) On 6/18/09, Tim

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Tim Evans
Alessandro Dentella wrote: > Hi, > > I'd like to connect to a 'button-press-event' of a column header of a > TreeViewColumn. As only clicked is provided, I set the widget:: > > label = gtk.Label(title) > box = gtk.EventBox() > box.add(label) > column.set_widget

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread ilya korcdmk
I've just tried a few ways... got nothing better than catching button press on the whole area of TreeView. Seems that widgets in column headers are not activatable, same as, for example, widgets packed into MenuItem 2009/6/17, Alessandro Dentella : > Hi, > > I'd like to connect to a 'button-pres

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread John Finlay
Alessandro Dentella wrote: > On Wed, Jun 17, 2009 at 08:16:37PM +0430, saeed wrote: > >> I even tried to use a custom class: >> class MyTreeviewColumn(gtk.TreeViewColumn, gtk.EventBox): >> def __init__(self, *args): >> gtk.TreeViewColumn.__init__(self, *args) >> gtk.EventBox.__

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Alessandro Dentella
On Wed, Jun 17, 2009 at 08:16:37PM +0430, saeed wrote: > I even tried to use a custom class: > class MyTreeviewColumn(gtk.TreeViewColumn, gtk.EventBox): > def __init__(self, *args): > gtk.TreeViewColumn.__init__(self, *args) > gtk.EventBox.__init__(self) > self.connect('butt

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread saeed
I even tried to use a custom calss: class MyTreeviewColumn(gtk.TreeViewColumn, gtk.EventBox): def __init__(self, *args): gtk.TreeViewColumn.__init__(self, *args) gtk.EventBox.__init__(self) self.connect('button-press-event', self.buttonPress) But it dosen't detect 'button-p

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread saeed
I even tried to use a custom class: class MyTreeviewColumn(gtk.TreeViewColumn, gtk.EventBox): def __init__(self, *args): gtk.TreeViewColumn.__init__(self, *args) gtk.EventBox.__init__(self) self.connect('button-press-event', self.buttonPress) But it doesn't detect 'button-p

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Alessandro Dentella
On Wed, Jun 17, 2009 at 02:08:00PM +0400, ilya korcdmk wrote: > Maybe you need to add event to catch button press with > > col.add_events(gtk.gdk.BUTTON_PRESS_MASK) thanks for the hint but it doesn't work column.add_events(gtk.gdk.BUTTON_PRESS_MASK) AttributeError: 'gtk.TreeViewColumn' object

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread ilya korcdmk
Maybe you need to add event to catch button press with col.add_events(gtk.gdk.BUTTON_PRESS_MASK) 2009/6/17, Alessandro Dentella : > On Wed, Jun 17, 2009 at 11:22:45AM +0200, Roberto Cavada wrote: >> Alessandro Dentella wrote: >> >> > but box_clicked_cb is never called. Why that? >> >> >> Use

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Alessandro Dentella
On Wed, Jun 17, 2009 at 11:22:45AM +0200, Roberto Cavada wrote: > Alessandro Dentella wrote: > > > but box_clicked_cb is never called. Why that? > > > Use 'clicked' signal, after enabling it: > > col = gtk.TreeViewColumn(...) > col.set_clickable(True) > col.connect("clicked", self.on_col_clic

Re: [pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Roberto Cavada
Alessandro Dentella wrote: > but box_clicked_cb is never called. Why that? Use 'clicked' signal, after enabling it: col = gtk.TreeViewColumn(...) col.set_clickable(True) col.connect("clicked", self.on_col_clicked) r. ___ pygtk mailing list pygtk

[pygtk] button-press-event on a TreeViewColumn Header?

2009-06-17 Thread Alessandro Dentella
Hi, I'd like to connect to a 'button-press-event' of a column header of a TreeViewColumn. As only clicked is provided, I set the widget:: label = gtk.Label(title) box = gtk.EventBox() box.add(label) column.set_widget(box) box.connect('button-press-event