def MkFileEnt(w): msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='Press the "open file" icon button and a TixFileSelectDialog will popup.') ent = Tix.FileEntry(w, label='Select a file : ') msg.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=3, pady=3) ent.pack(side=Tix.TOP, fill=Tix.X, padx=3, pady=3)
def createWidgets(self): self.infile_entry = Tix.FileEntry(self) self.infile_entry['dialogtype'] = 'tixExFileSelectDialog' self.infile_entry['label'] = 'GEDCOM:' self.infile_entry.pack(side='top',fill='x',expand=1) self.infile = Tix.StringVar() self.infile_entry['variable'] = self.infile self.infile_entry['command'] = self.inputChanged if self.conf.has_option('Common','input'): self.infile.set(self.conf.get('Common','input')) self.createLintWidgets() self.output = ScrolledText.ScrolledText(self) self.output['state'] = 'disabled' self.output.pack(side='bottom',fill='both',expand=1)
def createLintWidgets(self): lf = Tix.LabelFrame(self) lf['label'] = 'Lint' lf.pack(side='top',fill='both',expand=1) oe = Tix.FileEntry(lf) oe['dialogtype'] = 'tixExFileSelectDialog' oe['label'] = 'Lint output: (.html)' oe.pack(side='top',fill='x',expand=1) self.lint_output = Tix.StringVar() oe['variable'] = self.lint_output oe['command'] = self.lintOutputChanged if self.conf.has_option('Lint','output'): self.lint_output.set(self.conf.get('Lint','output')) ma = Tix.LabelEntry(lf) ma['label'] = 'Maximum age:' self.max_age = Tix.DoubleVar() ma.entry['textvariable'] = self.max_age self.max_age.set(0.0) ma.pack(side='top') opts = Tix.Select(lf,allowzero=True) opts['label'] = 'Options' opts.add('birth',text='birth') opts.add('death',text='death') opts.pack(side='top',expand=1) self.lint_options = Tix.StringVar() opts['variable'] = self.lint_options lb = Tix.Button(lf) lb['text'] = 'Run Lint' lb['command'] = self.runLint lb.pack(side='right')
def create_main_widgets(self): combo_box = Tix.ComboBox(self) combo_box.grid(column=0, row=0, sticky='news', padx=4, pady=4) button_box = Tix.ButtonBox(self) button_box.add('button_1', text='Button_1') button_box.add('button_2', text='Button_2') button_box.grid(column=0, row=1, sticky='news', padx=4, pady=4) control = Tix.Control(self) control.grid(column=0, row=2, sticky='news', padx=4, pady=4) label_entry = Tix.LabelEntry(self, label="Label for entry") label_entry.grid(column=0, row=3, sticky='news', padx=4, pady=4) meter = Tix.Meter(self) meter.grid(column=0, row=4, sticky='news', padx=4, pady=4) options = Tix.OptionMenu(self) options.grid(column=0, row=5, sticky='news', padx=4, pady=4) file_entry = Tix.FileEntry(self) file_entry.grid(column=0, row=6, sticky='news', padx=4, pady=4)
def execute_run(self): top = self.skyeye_body("Start running skyeye") tmp = Tix.Frame(top, padx=10, pady=15) b = Tix.Message(tmp, relief=Tix.FLAT, width=240, anchor=Tix.N, text='Below are the command to skyeye:') b.grid(row=0, padx=5, pady=15, sticky=W + E) tmp.grid(row=0, column=0, padx=5, pady=15, sticky=W + E) tmp = Tix.Frame(top, padx=10, pady=15) b = Tix.Message(tmp, relief=Tix.FLAT, width=440, anchor=Tix.N, text='skyeye') b.grid(row=0, column=0, padx=5, pady=3, sticky=W + E) b = Tix.Message(tmp, relief=Tix.FLAT, width=440, anchor=Tix.N, text='-e') b.grid(row=0, column=1, padx=5, pady=3, sticky=W + E) b = Tix.Message(tmp, relief=Tix.FLAT, width=440, anchor=Tix.N, text='-c') b.grid(row=1, column=1, padx=5, pady=3, sticky=W + E) self.image_path = Tix.Message(tmp, relief=Tix.FLAT, width=440, anchor=Tix.N, text='vmlinux') self.image_path.grid(row=0, column=2, padx=5, pady=3, sticky=W) self.conf_path = Tix.Message(tmp, relief=Tix.FLAT, width=440, anchor=Tix.N, text='skyeye.conf') self.conf_path.grid(row=1, column=2, padx=5, pady=3, sticky=W) file = Tix.FileEntry(tmp, command=self.image_path_do) file.grid(row=0, column=3, padx=5, pady=3, sticky=W + E) file = Tix.FileEntry(tmp, command=self.conf_path_do) file.grid(row=1, column=3, padx=5, pady=3, sticky=W + E) tmp.grid(row=1, column=0, padx=5, pady=10, sticky=W + E) tmp = Tix.Frame(top, padx=10, pady=15) tmp.grid(row=2, column=0, padx=5, pady=10, sticky=W + E) self.run = Tix.Button(tmp, text="Run", command=self.run_skyeye) self.kill = Tix.Button(tmp, text="Kill", command=self.kill_skyeye) self.kill.config(state=DISABLED) self.run.grid(row=0, column=0, padx=5, pady=3, sticky=W + E) self.kill.grid(row=0, column=1, padx=5, pady=3, sticky=W + E) self.skyeye_redobody()
def view_memory(self): self.message("You are now setting memory information") if self.memory_once == 1: self.memory_ok() return top = self.skyeye_body("Cpu & Mainboard") mem = Tix.Frame(top) b = Tix.Label(mem, text="Map :") map = Tix.OptionMenu(mem, command=self.memory_map) b.grid(row=0, column=0, padx=5, pady=3, sticky=W + E) map.grid(row=0, column=1, columnspan=2, padx=5, pady=3, sticky=W + E) b = Tix.Label(mem, text="Type :") type = Tix.OptionMenu(mem, command=self.memory_type) b.grid(row=1, column=0, padx=5, pady=3, sticky=W + E) type.grid(row=1, column=1, columnspan=2, padx=5, pady=3, sticky=W + E) b = Tix.Label(mem, text="'Addr :") addr = Tix.ComboBox(mem, editable=1, history=1, anchor=Tix.E, command=self.memory_addr) b.grid(row=2, column=0, padx=5, pady=3, sticky=W + E) addr.grid(row=2, column=1, columnspan=2, padx=5, pady=3, sticky=W + E) b = Tix.Label(mem, text="Size :") size = Tix.ComboBox(mem, editable=1, history=1, anchor=Tix.E, command=self.memory_size) b.grid(row=3, column=0, padx=5, pady=3, sticky=W + E) size.grid(row=3, column=1, columnspan=2, padx=5, pady=3, sticky=W + E) b = Tix.Label(mem, text="File :") file = Tix.FileEntry(mem, command=self.memory_file) b.grid(row=4, column=0, padx=5, pady=3, sticky=W + E) file.grid(row=4, column=1, columnspan=2, padx=5, pady=3, sticky=W + E) add = Tix.Button(top, text="Add", command=self.memory_add) reset = Tix.Button(top, text="Reset", command=self.memory_reset) ok = Tix.Button(top, text="OK", command=self.memory_ok) map.add_command("I", label="I") map.add_command("M", label="M") type.add_command("R", label="R") type.add_command("W", label="W") type.add_command("RW", label="RW") addr.insert(Tix.END, "0x00000000") size.insert(Tix.END, "0x00000000") mem.grid(row=0, column=0, columnspan=3, padx=5, pady=10, sticky=N + S + W + E) add.grid(row=1, column=0, padx=5, pady=10, sticky=W + E) reset.grid(row=1, column=1, padx=5, pady=10, sticky=W + E) ok.grid(row=1, column=2, padx=5, pady=10, sticky=W + E) self.skyeye_redobody()
# -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-