summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/ObjectBrowser.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/ObjectBrowser.py')
-rw-r--r--Lib/idlelib/ObjectBrowser.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/idlelib/ObjectBrowser.py b/Lib/idlelib/ObjectBrowser.py
index b359efc..7b57aa4 100644
--- a/Lib/idlelib/ObjectBrowser.py
+++ b/Lib/idlelib/ObjectBrowser.py
@@ -9,6 +9,8 @@
# XXX TO DO:
# - for classes/modules, add "open source" to object browser
+import re
+
from idlelib.TreeWidget import TreeItem, TreeNode, ScrolledCanvas
from reprlib import Repr
@@ -119,12 +121,14 @@ def make_objecttreeitem(labeltext, object, setfunction=None):
c = ObjectTreeItem
return c(labeltext, object, setfunction)
-# Test script
-def _test():
+def _object_browser(parent):
import sys
from tkinter import Tk
root = Tk()
+ root.title("Test ObjectBrowser")
+ width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
+ root.geometry("+%d+%d"%(x, y + 150))
root.configure(bd=0, bg="yellow")
root.focus_set()
sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
@@ -135,4 +139,5 @@ def _test():
root.mainloop()
if __name__ == '__main__':
- _test()
+ from idlelib.idle_test.htest import run
+ run(_object_browser)