![]() Line 9 is to get the formatted string and line 10 is to get the showinfo message dialog. Line 9 is to get the "values" information of the double click, which is the City content. Line 8 is to get the "text" information of the double click, which is the state content. The first parameter xxx can be item, column, row, which are the coordinates of the double click, and get the information of item, column or row when double clicked, this example is using item, so we can get which item was double clicked. ![]() Line 6 is to get the control of the double-click event, and line 7 identifi( ) method is used as follows. Line 31 of the above program binds the double-click operation to the doubleClick( ) method, so when a double-click is made the doubleClick( ) method in lines 5 to 11 will be executed. Tree.bind("",doubleClick) # Double-click binding doubleClick method Tree.insert("",index=END,text=state,values=stateCity) Tree.heading("#0",text="State") # Icon bar Iid = e.identify("item",event.x,event.y) # Get the double-click item idĬity = e.item(iid,"values") # Get city When double-clicking on an item in the Treeview control, a dialog box appears listing the selected item. When a double click occurs in a Treeview control, a event is generated, which we can use to build an event handler for the double click.įor this type of problem, another focus is to obtain the double-click item, which will be explained with an example below. ![]() When using the Treeview control, it is often necessary to perform double-click operations, most often to open a document.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |