if (__name__ == '__main__'): from memops.gui.Button import Button from memops.gui.Util import createQuitButton def getText(): print 'getText:', text.getText() root = Tkinter.Tk() frame = Frame(root) frame.pack(side=Tkinter.TOP) button = Button(frame, text='get text', command=getText) button.pack(side=Tkinter.LEFT) button = createQuitButton(frame) button.pack(side=Tkinter.LEFT) text = ScrolledText( root, width=60, height=10, #text='in the beginning') text='in the beginning', xscroll=False) text.pack(side=Tkinter.TOP, expand=Tkinter.YES, fill=Tkinter.BOTH) root.mainloop()
] attributes = ['x', 'y', 'w', 'z'] attributeHeadings = { 'x': 'SW', 'y': 'SF', 'w': 'TPPI?', 'z': 'Manufacturer' } widgetClasses = { 'x': Entry, 'y': Entry, 'w': CheckButton, 'z': PulldownMenu } constructorKw = {'z': {'entries': ['Bruker', 'Varian']}} root.top = root t = ObjectsTable(root, objects=objects, widgetClasses=widgetClasses, constructorKw=constructorKw, attributes=attributes, attributeHeadings=attributeHeadings, attributeDirection=Tkinter.HORIZONTAL, help_msg='Help message') t.grid(row=0, column=0, sticky=Tkinter.NSEW) button = createQuitButton(root) button.grid(row=1) root.mainloop()