NEW Tree Element!
This commit is contained in:
parent
6d123a44eb
commit
5d487bf5fe
4 changed files with 177 additions and 7 deletions
29
Demo_Tree_Element.py
Normal file
29
Demo_Tree_Element.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env python
|
||||
import sys
|
||||
if sys.version_info[0] >= 3:
|
||||
import PySimpleGUI as sg
|
||||
else:
|
||||
import PySimpleGUI27 as sg
|
||||
|
||||
treedata = sg.TreeData()
|
||||
|
||||
treedata.Insert("", '_A_', 'A', [1,2,3])
|
||||
treedata.Insert("", '_B_', 'B', [4,5,6])
|
||||
treedata.Insert("_A_", '_A1_', 'A1', ['can','be','anything'])
|
||||
treedata.Insert("", '_C_', 'C', [])
|
||||
treedata.Insert("_C_", '_C1_', 'C1', ['or'])
|
||||
treedata.Insert("_A_", '_A2_', 'A2', [None, None])
|
||||
treedata.Insert("_A1_", '_A3_', 'A30', ['getting deep'])
|
||||
treedata.Insert("_C_", '_C2_', 'C2', ['nothing', 'at', 'all'])
|
||||
|
||||
layout = [[ sg.Text('Tree Test') ],
|
||||
[ sg.Tree(data=treedata, headings=['col1', 'col2', 'col3'], auto_size_columns=True, num_rows=10, col0_width=10)],
|
||||
[ sg.RButton('Read')]]
|
||||
|
||||
window = sg.Window('Tree Element Test').Layout(layout)
|
||||
|
||||
while True: # Event Loop
|
||||
button, value = window.Read()
|
||||
if button is None:
|
||||
break
|
||||
print(button, value)
|
Loading…
Add table
Add a link
Reference in a new issue