jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
615 stars 67 forks source link

How make a selection a branch in tree with double click? #621

Open fullmacht opened 4 years ago

fullmacht commented 4 years ago

How to get the value of selected with double clicked branch in tree? How to make this double click function in appJar?

jarvisteach commented 3 years ago

The tree is still a little buggy...

You could try this code:

from appJar import gui
def click(tree, id):
    print(app.getTreeSelectedXML(tree))

with gui() as app:
    app.addTree("t1",
        """<people>
        <person><name>Fred</name><age>45</age><gender>Male</gender></person>
        <person><name>Tina</name><age>37</age><gender>Female</gender></person>
        <person><name>CLive</name><age>28</age><gender>Male</gender></person>
        <person><name>Betty</name><age>51</age><gender>Female</gender></person>
        </people>""")
    app.setTreeDoubleClickFunction('t1', click)