[pygtk] treeview with context menu and multiselect

Cornelius Kölbel cornelius.koelbel at lsexperts.de
Sun Mar 7 23:00:17 WST 2010


Hi list,

I got a treeview with multiselect.
I created a context menu for this treeview

I connected GtkWidget.buttong-press-event to
on_userTreeview_button_press_event via glade.

  def on_userTreeview_button_press_event(self, widget, event):
    if event.button==3:
        self.popupUserMenu.popup(None, None, None, event.button, event.time)


But when I select several entries and hit the right mouse button, I
loose all selections and only the entry beneath is selected. So i
suspect that my connect is somehow "late", after the default (selecting)
acted on the treeview or that I need to delete the event, so that the
default action does not take place.

Could you point me to the right direction?

THanks and kind regards
Cornelius





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20100307/ed9759c7/attachment.pgp 


More information about the pygtk mailing list