Commit e7e8d1e1 authored by Guido van Rossum's avatar Guido van Rossum

Change remote operation -- display the widget tree in a listbox and

open relevant dialogs on double click
parent 3284abe7
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
# -- totally static, though different between PackDialog and WidgetDialog # -- totally static, though different between PackDialog and WidgetDialog
# (but even that could be unified) # (but even that could be unified)
from Tkinter import * from Tkinter import *
class Option: class Option:
...@@ -406,9 +405,8 @@ def test(): ...@@ -406,9 +405,8 @@ def test():
import sys import sys
root = Tk() root = Tk()
root.minsize(1, 1) root.minsize(1, 1)
if sys.argv[2:]: if sys.argv[1:]:
pd = RemotePackDialog(root, sys.argv[1], sys.argv[2]) remotetest(root, sys.argv[1])
wd = RemoteWidgetDialog(root, sys.argv[1], sys.argv[2])
else: else:
frame = Frame(root, {'name': 'frame', frame = Frame(root, {'name': 'frame',
Pack: {'expand': 1, 'fill': 'both'}, Pack: {'expand': 1, 'fill': 'both'},
...@@ -426,4 +424,24 @@ def test(): ...@@ -426,4 +424,24 @@ def test():
cwd = WidgetDialog(canvas) cwd = WidgetDialog(canvas)
root.mainloop() root.mainloop()
def remotetest(root, app):
from listtree import listtree
list = listtree(root, app)
list.bind('<Any-Double-1>', opendialogs)
list.app = app # Pass it on to handler
def opendialogs(e):
import string
list = e.widget
sel = list.curselection()
for i in sel:
item = list.get(i)
widget = string.split(item)[0]
RemoteWidgetDialog(list, list.app, widget)
if widget == '.': continue
try:
RemotePackDialog(list, list.app, widget)
except TclError, msg:
print msg
test() test()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment