Fixed right-click with no selection issue

svn: r15666
This commit is contained in:
Doug Blank 2010-07-30 05:13:32 +00:00
parent 77e5629012
commit 6175654510

View File

@ -94,7 +94,7 @@ class SimpleTable(object):
selection = treeview.get_selection()
store, paths = selection.get_selected_rows()
tpath = paths[0] if len(paths) > 0 else None
node = store.get_iter(tpath)
node = store.get_iter(tpath) if tpath else None
if node:
treeview.grab_focus()
index = store.get_value(node, 0)
@ -116,7 +116,7 @@ class SimpleTable(object):
selection = treeview.get_selection()
store, paths = selection.get_selected_rows()
tpath = paths[0] if len(paths) > 0 else None
node = store.get_iter(tpath)
node = store.get_iter(tpath) if tpath else None
if path:
treeview.grab_focus()
treeview.set_cursor(path, col, 0)
@ -178,7 +178,7 @@ class SimpleTable(object):
selection = obj.get_selection()
store, paths = selection.get_selected_rows()
tpath = paths[0] if len(paths) > 0 else None
node = store.get_iter(tpath)
node = store.get_iter(tpath) if tpath else None
if not node:
return
index = store.get_value(node, 0) # index