mirror of https://github.com/python/cpython
Make the test program work outside IDLE.
This commit is contained in:
parent
6d0cee1170
commit
ef92edd903
|
@ -134,18 +134,18 @@ def make_objecttreeitem(labeltext, object, setfunction=None):
|
||||||
|
|
||||||
# Test script
|
# Test script
|
||||||
|
|
||||||
def test():
|
def _test():
|
||||||
import sys
|
import sys
|
||||||
from Tkinter import Toplevel
|
from Tkinter import Tk
|
||||||
import PyShell
|
root = Tk()
|
||||||
root = Toplevel(PyShell.root)
|
|
||||||
root.configure(bd=0, bg="yellow")
|
root.configure(bd=0, bg="yellow")
|
||||||
root.focus_set()
|
root.focus_set()
|
||||||
sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
|
sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
|
||||||
sc.frame.pack(expand=1, fill="both")
|
sc.frame.pack(expand=1, fill="both")
|
||||||
item = make_objecttreeitem("sys", sys)
|
item = make_objecttreeitem("sys", sys)
|
||||||
node = TreeNode(sc.canvas, None, item)
|
node = TreeNode(sc.canvas, None, item)
|
||||||
node.expand()
|
node.update()
|
||||||
|
root.mainloop()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
test()
|
_test()
|
||||||
|
|
Loading…
Reference in New Issue