def fillInUI(self, parent): from CGLtk import Hybrid parent.columnconfigure(0, weight=1) row = 0 vl = Hybrid.Scrollable_List(parent, 'Memory use', 5) vl.listbox['font'] = 'Courier' # fixed width font so columns line up vl.heading['font'] = 'Courier' self.object_listbox = vl.listbox self.object_list_heading = vl.heading vl.frame.grid(row=row, column=0, sticky='news') parent.rowconfigure(row, weight=1) row = row + 1 self.update_use()
def fillInUI(self, parent): self.key_buffer = '' self.key_callback_registered = None self.time_out_id = None import Accelerators self.preferences = Accelerators.accelerator_preferences_category() self.top = parent.winfo_toplevel() self.top.wm_withdraw() # Do not show automatically when dialog created parent.columnconfigure(0, weight = 1) row = 0 import Tkinter from CGLtk import Hybrid al = Hybrid.Scrollable_List(parent, 'Available shortcuts', 10, self.accelerator_selection_cb) self.accelerator_listbox = al.listbox al.frame.grid(row = row, column = 0, sticky = 'news') parent.rowconfigure(row, weight = 1) row = row + 1 fi = Hybrid.Entry(parent, 'Filter list ', 20) fi.entry.bind('<KeyRelease>', self.filter_cb) fi.frame.grid(row = row, column = 0, sticky = 'ew') self.filter_text = fi.variable row = row + 1 ao = Hybrid.Checkbutton(parent, 'Enable keyboard shortcuts', False) ao.button.grid(row = row, column = 0, sticky = 'w') row = row + 1 ao.callback(self.activate_accelerators_cb) self.active_var = ao.variable from chimera import statusline sl = Hybrid.Checkbutton(parent, 'Show main window status line', statusline.status_line_shown()) sl.button.grid(row = row, column = 0, sticky = 'w') row = row + 1 sl.callback(self.status_line_cb) self.status_line_var = sl.variable from chimera import triggers triggers.addHandler('status line', self.status_line_visibility_cb, None) rf = Tkinter.Frame(parent) rf.grid(row = row, column = 0, sticky = 'w') row = row + 1 rb = Tkinter.Button(rf, text = 'Load', command = self.load_cb) rb.grid(row = 0, column = 0, sticky = 'w') afl = Tkinter.Label(rf, text = ' shortcuts file') afl.grid(row = 0, column = 1, sticky = 'w') path = self.preferences['path'] # Path might be None af = Hybrid.Entry(parent, '', 20, path) af.entry.xview_moveto(1) # show right most part of path af.entry.bind('<KeyPress-Return>', self.load_cb) af.frame.grid(row = row, column = 0, sticky = 'ew') row = row + 1 self.accelerator_file = af.variable tot = self.preferences['time out'] tm = Hybrid.Entry(parent, 'Key press time-out (seconds) ', 3, tot) tm.frame.grid(row = row, column = 0, sticky = 'w') row = row + 1 self.time_out = tm.variable self.time_out.add_callback(self.time_out_changed_cb) # # Specify a label width so dialog is not resized for long messages. # msg = Tkinter.Label(parent, width = 30, anchor = 'w', justify = 'left') msg.grid(row = row, column = 0, sticky = 'ew') row = row + 1 self.message_label = msg self.load_accelerators()