Exemplo n.º 1
0
def StackBrowser(root, flist=None, stack=None):
    top = Toplevel(root)
    sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
    sc.frame.pack(expand=1, fill="both")
    item = StackTreeItem(flist)
    node = TreeNode(sc.canvas, None, item)
    node.expand()
Exemplo n.º 2
0
 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.CurrentTheme()
     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 build_window(self):
		self.root = Tkinter.Tk()
		self.root.title('CDR/CMX/CDRX Explorer')
		
		if os.name == 'nt':
			self.root.option_readfile('tkDefaultsWin', 'interactive')
			self.browsePath='../../'
		else:
			self.root.option_readfile('tkDefaults', 'interactive')
		
		self.root.geometry('600x600+30+50')
		
		frame = Tkinter.Frame(self.root, border=5, relief='flat')
		frame.pack(side='top', expand=1, fill='both')
		
		treeFrame = Tkinter.Frame(frame, border=1, relief='flat', bg='#595D61')
		treeFrame.pack(side='left', expand=1, fill='both')
		
		self.preview=PreviewPanel(frame)
		self.preview.frame.pack(side='right', anchor='ne')
		
		self.refreshButton=WebButton(self.preview.frame, text='Refresh', command=self.build_tree)
		self.refreshButton.frame.pack(side='bottom', pady=10)
		
		self.tree = ScrolledCanvas(treeFrame, bg='#EDEDED', highlightthickness=0, takefocus=1)
		self.tree.frame.pack(side='top', expand=1, fill='both')
		self.build_tree()
Exemplo n.º 4
0
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()
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
def test():
    root = Tk()
    sys.exitfunc = root.quit
    root.configure(bd=0, bg="yellow")
    root.title("terminal directory changer")
    root.focus_set()
    sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
    sc.frame.pack(expand=1, fill="both")
    item = MyFileTreeItem('/')
    node = TreeNode(sc.canvas, None, item)
    node.expand()
    root.mainloop()
Exemplo n.º 7
0
def test():
    import sys
    from Tkinter import Toplevel
    import PyShell
    root = Toplevel(PyShell.root)
    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.expand()
Exemplo n.º 8
0
 def remote_stack_viewer(self):
     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 TreeWidget import ScrolledCanvas, TreeNode
     top = Toplevel(self.tkconsole.root)
     sc = ScrolledCanvas(top, bg="white", highlightthickness=0)
     sc.frame.pack(expand=1, fill="both")
     node = TreeNode(sc.canvas, None, item)
     node.expand()
Exemplo n.º 9
0
 def remote_stack_viewer(self):
     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 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()
Exemplo n.º 10
0
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()
Exemplo n.º 11
0
 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)
     self.settitle()
     top.focus_set()
     # create scrolled canvas
     sc = ScrolledCanvas(top, bg="white", 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()
Exemplo n.º 12
0
 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)
     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()
Exemplo n.º 13
0
def main():
    parser = ArgumentParser(description='browse a bookmarks_xxx.json file')
    parser.add_argument('jbfile',
                        help='the json file containing the bookmarks')
    args = parser.parse_args()
    root = Tk()
    sys.exitfunc = root.quit
    root.configure(bd=0, bg="yellow")
    root.title("bookmarks browser")
    root.focus_set()
    sc = ScrolledCanvas(root, bg="white", highlightthickness=0, takefocus=1)
    sc.frame.pack(expand=1, fill="both")
    fn = args.jbfile
    D = eval(file(fn).read())
    D['title'] = fn
    item = MyFileTreeItem(D)
    node = TreeNode(sc.canvas, None, item)
    node.expand()
    root.mainloop()
Exemplo n.º 14
0
"""Class browser.
Exemplo n.º 15
0
import os
Exemplo n.º 16
0
# XXX TO DO: