summaryrefslogtreecommitdiff
path: root/Lib/idlelib/tree.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-06-10 18:19:21 -0400
committerTerry Jan Reedy <tjreedy@udel.edu>2016-06-10 18:19:21 -0400
commit01e35754fb8a7bcaf88a473db1eb30a14378a49e (patch)
tree66a35e9f29de268b16e00faa5a648cb12a45b743 /Lib/idlelib/tree.py
parent96881cd6218000380d4a6ce60ff47bb6d785e524 (diff)
downloadcpython-git-01e35754fb8a7bcaf88a473db1eb30a14378a49e.tar.gz
Issue *24750: Switch all scrollbars in IDLE to ttk versions.
Where needed, add minimal tests to cover changes.
Diffstat (limited to 'Lib/idlelib/tree.py')
-rw-r--r--Lib/idlelib/tree.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/Lib/idlelib/tree.py b/Lib/idlelib/tree.py
index 08cc6370dd..cb7f9ae4b4 100644
--- a/Lib/idlelib/tree.py
+++ b/Lib/idlelib/tree.py
@@ -16,7 +16,7 @@
import os
from tkinter import *
-
+from tkinter.ttk import Scrollbar
from idlelib import zoomheight
from idlelib.config import idleConf
@@ -449,18 +449,17 @@ class ScrolledCanvas:
return "break"
-def _tree_widget(parent):
- root = Tk()
- root.title("Test TreeWidget")
+def _tree_widget(parent): # htest #
+ top = Toplevel(parent)
width, height, x, y = list(map(int, re.split('[x+]', parent.geometry())))
- root.geometry("+%d+%d"%(x, y + 150))
- sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
+ top.geometry("+%d+%d"%(x+50, y+175))
+ sc = ScrolledCanvas(top, bg="white", highlightthickness=0, takefocus=1)
sc.frame.pack(expand=1, fill="both", side=LEFT)
- item = FileTreeItem(os.getcwd())
+ item = FileTreeItem(ICONDIR)
node = TreeNode(sc.canvas, None, item)
node.expand()
- root.mainloop()
if __name__ == '__main__':
+ # test_tree is currently a copy of this
from idlelib.idle_test.htest import run
run(_tree_widget)