How do I do something when the user right-clicks in a tree row?
It is very simple, just listen to the button-press-event signal and use treeview.get_path_at_pos() to display the selected row:
treeview.get_path_at_pos()
def button_press_event(treeview, event): if event.button == 3: # right click model, path = treeview.get_path_at_pos(int(event.x), int(event.y)) # do something with the selected path treeview.connect('button-press-event' , button_press_event)
Source: https://habr.com/ru/post/1333898/More articles:Seed spread - ruby-on-railsto create an excel file in .net without installed office - .netDrop-down menus appearing behind flash video - flashmulti-line terminal status indicator? - phpAspx radiobutton checklist in one line - asp.netInvert OpacityMask - wpfInstall pygraphviz on windows - windowsConsolidation of coding styles: Funcs, private method, single methods classes - c #https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1333902/wait-for-tasks-to-get-completed-in-threadpool&usg=ALkJrhivswm7GlfVj6gVMMeqbwng1iA1ewProblem parsing an XML file - c #All Articles