def __init__(self, parent): super().__init__(parent) self.parent = parent self.create_toolbar() self.sc = ScrolledCanvas(parent, bg="white", highlightthickness=0, takefocus=1) self.sc.frame.pack(expand=1, fill='both')
def init(self, flist): self.flist = flist # reset pyclbr pyclbr._modules.clear() # create top # NOTE: later we will be passed in container, rather than creating it self.top = top = flist.new_container(own_window=True) self.top.add_component(self) top.top.bind("<Escape>", self.close) if self._htest: # place dialog below parent if running htest top.top.geometry( "+%d+%d" % (flist.root.winfo_rootx(), flist.root.winfo_rooty() + 200)) top.top.focus_set() # create scrolled canvas theme = idleConf.CurrentTheme() background = idleConf.GetHighlight(theme, 'normal')['background'] sc = ScrolledCanvas(top.w, bg=background, highlightthickness=0, takefocus=1) sc.frame.pack(expand=1, fill="both") item = self.rootnode() self.node = node = TreeNode(sc.canvas, None, item) node.update() node.expand()
def init(self, flist): self.flist = flist # reset pyclbr pyclbr._modules.clear() # create top self.top = top = ListedToplevel(flist.root) top.protocol("WM_DELETE_WINDOW", self.close) top.bind("<Escape>", self.close) if self._htest: # place dialog below parent if running htest top.geometry( "+%d+%d" % (flist.root.winfo_rootx(), flist.root.winfo_rooty() + 200)) self.settitle() top.focus_set() # create scrolled canvas theme = idleConf.GetOption('main', 'Theme', 'name') background = idleConf.GetHighlight(theme, 'normal')['background'] sc = ScrolledCanvas(top, bg=background, highlightthickness=0, takefocus=1) sc.frame.pack(expand=1, fill="both") item = self.rootnode() self.node = node = TreeNode(sc.canvas, None, item) node.update() node.expand()
def StackBrowser(root, flist=None, tb=None, top=None): if top is None: top = tk.Toplevel(root) sc = ScrolledCanvas(top, bg="white", highlightthickness=0) sc.frame.pack(expand=1, fill="both") item = StackTreeItem(flist, tb) node = TreeNode(sc.canvas, None, item) node.expand()
def StackBrowser(root, flist=None, tb=None, top=None): if top is None: from Tkinter import Toplevel top = Toplevel(root) sc = ScrolledCanvas(top, bg='white', highlightthickness=0) sc.frame.pack(expand=1, fill='both') item = StackTreeItem(flist, tb) node = TreeNode(sc.canvas, None, item) node.expand() return
def _test(): import sys from Tkinter import Tk root = Tk() root.configure(bd=0, bg="yellow") root.focus_set() sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1) sc.frame.pack(expand=1, fill="both") item = make_objecttreeitem("sys", sys) node = TreeNode(sc.canvas, None, item) node.update() root.mainloop()
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) sc.frame.pack(expand=1, fill="both") item = make_objecttreeitem("sys", sys) node = TreeNode(sc.canvas, None, item) node.update() root.mainloop()
def remote_stack_viewer(self): from idlelib import RemoteObjectBrowser oid = self.rpcclt.remotequeue("exec", "stackviewer", ("flist",), {}) if oid is None: self.tkconsole.root.bell() return item = RemoteObjectBrowser.StubObjectTreeItem(self.rpcclt, oid) from idlelib.TreeWidget import ScrolledCanvas, TreeNode top = Toplevel(self.tkconsole.root) theme = idleConf.GetOption('main','Theme','name') background = idleConf.GetHighlight(theme, 'normal')['background'] sc = ScrolledCanvas(top, bg=background, highlightthickness=0) sc.frame.pack(expand=1, fill="both") node = TreeNode(sc.canvas, None, item) node.expand()
def init(self, flist): self.flist = flist pyclbr._modules.clear() self.top = top = ListedToplevel(flist.root) top.protocol('WM_DELETE_WINDOW', self.close) top.bind('<Escape>', self.close) self.settitle() top.focus_set() theme = idleConf.GetOption('main', 'Theme', 'name') background = idleConf.GetHighlight(theme, 'normal')['background'] sc = ScrolledCanvas(top, bg=background, highlightthickness=0, takefocus=1) sc.frame.pack(expand=1, fill='both') item = self.rootnode() self.node = node = TreeNode(sc.canvas, None, item) node.update() node.expand() return
from Tkinter import Tk from idlelib.TreeWidget import ScrolledCanvas, FileTreeSystem, TreeNode import os root = Tk() root.title("File Browser") sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1) sc.frame.pack(expand=1, fill="both", side="left") item = FileTreeItem(os.getcwd()) node = TreeNode(sc.canvas, None, item) node.expand() root.mainloop()