Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Doubleclick .py Prep

import tkinter as tk
from tkinter import ttk

class App:
    def __init__(self):
        self.root = tk.Tk()
        self.tree = ttk.Treeview()
        self.tree.pack()
        for i in range(10):
            self.tree.insert("", "end", text="Item %s" % i)
        self.tree.bind("<Double-1>", self.OnDoubleClick)
        self.root.mainloop()

    def OnDoubleClick(self, event):
        item = self.tree.selection()[0]
        print("you clicked on", self.tree.item(item,"text"))

if __name__ == "__main__":
    app = App()
Comment

Doubleclick .py Prep Mac

import tkinter as tk
import tkinter.ttk as ttk

class App:
    def __init__(self):
        self.root = tk.Tk()
        self.tree = ttk.Treeview()
        self.tree.pack()
        for i in range(10):
            self.tree.insert("", "end", text="Item %s" % i)
        self.tree.bind("<Double-1>", self.OnDoubleClick)
        self.root.mainloop()

    def OnDoubleClick(self, event):
        item = self.tree.identify('item',event.x,event.y)
        print("you clicked on", self.tree.item(item,"text"))

if __name__ == "__main__":
    app = App()
Comment

PREVIOUS NEXT
Code Example
Python :: list cwd python 
Python :: pairplot hide original legend 
Python :: extended slices [::2] 
Python :: Pandas number of columns display settings 
Python :: pairplot yaxis diagonal 
Python :: program to add two numbers in python 
Python :: two lists with identical entries get order 
Python :: saving a dta file 
Python :: Python getting content from xl range 
Python :: Python Anagram Using Counter() function 
Python :: Code Example to Check the type of None object 
Python :: Simple Example to Plot Python Treemap with lables 
Python :: how to change multiple index in list in python 
Python :: ascii julius caesar python encryption 
Python :: keyword argument python 
Python :: boto3 get_item 
Python :: python sqlite select where 
Python :: python is x string methods 
Python :: apply WEKA filter on customer dataset 
Python :: Python NumPy ravel function example Showing ordering manipulation 
Python :: find duplicate row in python sqlite database 
Python :: Python NumPy require Function Syntax 
Python :: python locateonscreen method 
Python :: maximaze window in tkinter 
Python :: NumPy trim_zeros Syntax 
Python :: colorbar over two axes 
Python :: Printing a long code line to span over multiple lines 
Python :: complete dates pandas per group by 
Python :: python call c function 
Python :: list x[:-1] 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =