summaryrefslogtreecommitdiffstats
path: root/Demo/tkinter/guido/listtree.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-12-30 21:33:07 (GMT)
committerGeorg Brandl <georg@python.org>2010-12-30 21:33:07 (GMT)
commit7fafbc95c0c963438197c9a43fe893c4ea6fe759 (patch)
tree5c9ceda4bdc5260236a230554b9ed56b8c0cdbd3 /Demo/tkinter/guido/listtree.py
parent6f17e2df29a865a29447531e89fb22be710e382d (diff)
downloadcpython-7fafbc95c0c963438197c9a43fe893c4ea6fe759.zip
cpython-7fafbc95c0c963438197c9a43fe893c4ea6fe759.tar.gz
cpython-7fafbc95c0c963438197c9a43fe893c4ea6fe759.tar.bz2
More cleanup: Move some demos into a dedicated Tools/demo dir, move 2to3 demo to Tools, and remove all the other Demo content.
Diffstat (limited to 'Demo/tkinter/guido/listtree.py')
-rw-r--r--Demo/tkinter/guido/listtree.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/Demo/tkinter/guido/listtree.py b/Demo/tkinter/guido/listtree.py
deleted file mode 100644
index 8db5b60..0000000
--- a/Demo/tkinter/guido/listtree.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# List a remote app's widget tree (names and classes only)
-
-import sys
-
-from tkinter import *
-
-def listtree(master, app):
- list = Listbox(master, name='list')
- list.pack(expand=1, fill=BOTH)
- listnodes(list, app, '.', 0)
- return list
-
-def listnodes(list, app, widget, level):
- klass = list.send(app, 'winfo', 'class', widget)
- list.insert(END, '%s (%s)' % (widget, klass))
- children = list.tk.splitlist(
- list.send(app, 'winfo', 'children', widget))
- for c in children:
- listnodes(list, app, c, level+1)
-
-def main():
- if not sys.argv[1:]:
- sys.stderr.write('Usage: listtree appname\n')
- sys.exit(2)
- app = sys.argv[1]
- tk = Tk()
- tk.minsize(1, 1)
- f = Frame(tk, name='f')
- f.pack(expand=1, fill=BOTH)
- list = listtree(f, app)
- tk.mainloop()
-
-if __name__ == '__main__':
- main()