Prevent selecting filter view category labels

This commit is contained in:
Andrew Resch 2008-08-24 05:53:56 +00:00
parent 2d26005dcf
commit 1747bd9894
1 changed files with 18 additions and 0 deletions

View File

@ -202,7 +202,25 @@ class FilterTreeView(component.Component):
"""This is a callback for showing the right-click context menu.
NOT YET!
"""
x, y = event.get_coords()
path = self.label_view.get_path_at_pos(int(x), int(y))
if not path:
return
path = path[0]
cat = self.model_filter[path][0]
if event.button == 1:
# Prevent selecting a category label
if cat == "cat":
return True
elif event.button == 3:
if cat == "cat":
# XXX: Show the pop-up menu
# Do not select the row
return True
"""
# We only care about right-clicks
if event.button == 3:
x, y = event.get_coords()