[pygtk] button-press-event on a TreeViewColumn Header?
saeed
saeed.gnu at gmail.com
Wed Jun 17 23:49:31 WST 2009
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-press-event'.
Would be the header of treeview was accessible as a separate widget,
or the TreeViewColums was a gtk.Widget not only a gtk.Object! :-D
The only way that I found is that: if you don't need to resize columns,
simply ignore the header of treeview(and make it invisible), and use
the first row of treeview as its header. And maybe change the color of
that first row, and maybe define the sorting of rows manually (when clicked
on the first row)...
Seems there is not a better way!!
On 6/17/09, Alessandro Dentella <sandro at e-den.it> wrote:
> 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 has no attribute 'add_events'
>
> On the other hand, I already added a widget (EventBox) as header of the
> column and Im connecting directly to the EventBox, so why should the
> column sensitivness be implied?
>
>
> sandro
> *:-)
> _______________________________________________
> pygtk mailing list pygtk at daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://faq.pygtk.org/
>
More information about the pygtk
mailing list