def setup_radio_buttons(self): '''add atemporal vs temporal choice part''' dct = self.user_input temporal_processing_flag = BooleanVar() # get context dependent frame (regular) regular = Raw2Attributes() regular_frame = regular.make_frame(self) reg_button = Radiobutton(self, text='raw2attributes', value=False, variable=temporal_processing_flag) reg_button.grid(row=11, column=0, sticky=W) # get context dependent frame (temporal) temporal = Raw2Patterns() temporal_frame = temporal.make_frame(self) tmprl_button = Radiobutton(self, text='raw2patterns', value=True, variable=temporal_processing_flag) tmprl_button.grid(row=11, column=1, sticky=W) # configure events, invoke one by default reg_button.configure(command=lambda : self.set_frame(regular_frame, temporal_frame)) tmprl_button.configure(command=lambda : self.set_frame(temporal_frame, regular_frame)) reg_button.invoke() # default dct['process_temporal'] = temporal_processing_flag dct['a-temporal_specific'] = regular.get_values() dct['temporal_specific'] = temporal.get_values()
def setup_radio_buttons(self): '''add atemporal vs temporal choice part''' dct = self.user_input temporal_processing_flag = BooleanVar() # get context dependent frame (regular) regular = Raw2Attributes() regular_frame = regular.make_frame(self) reg_button = Radiobutton(self, text='raw2attributes', value=False, variable=temporal_processing_flag) reg_button.grid(row=12, column=0, sticky=W) # get context dependent frame (temporal) temporal = Raw2Patterns() temporal_frame = temporal.make_frame(self) tmprl_button = Radiobutton(self, text='raw2patterns', value=True, variable=temporal_processing_flag) tmprl_button.grid(row=12, column=1, sticky=W) # configure events, invoke one by default reg_button.configure( command=lambda: self.set_frame(regular_frame, temporal_frame)) tmprl_button.configure( command=lambda: self.set_frame(temporal_frame, regular_frame)) reg_button.invoke() # default dct['process_temporal'] = temporal_processing_flag dct['a-temporal_specific'] = regular.get_values() dct['temporal_specific'] = temporal.get_values()
def __init__(self, master): plat = platform.system() if plat == 'Darwin': try: system( '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python" to true' ''' ) print("Trying to force Python window to the front on macOS") except: system( '''/usr/bin/osascript -e 'tell app "Finder" to set frontmost of process "Python2.7" to true' ''' ) print( "Trying to force Python 2.7 window to the front on macOS") self.master = master frame = Frame(master) frame.config(background="#dcdcdc") frame.config(borderwidth=5, relief=GROOVE) frame.place(relx=0.5, rely=0.5, anchor=CENTER) master.title('Verify v. 0.2') # Main frame title master.config(background="#dcdcdc") master.geometry('820x750') menubar = Menu(master) """statmenu = Menu(menubar,tearoff=0) statmenu.add_command(label="Fieller", command=self.on_fieller) statmenu.rantest = Menu(statmenu) statmenu.rantest.add_command(label="Continuously variable data", command=self.on_rantest_continuous) statmenu.rantest.add_command(label="Binomial data (each result= yes or no)", command=self.on_rantest_binomial) statmenu.add_cascade(label="Randomisation test", menu=statmenu.rantest) statmenu.add_command(label="Help", command=self.on_help, state=DISABLED) statmenu.add_command(label="Quit", command=master.quit) menubar.add_cascade(label="Statistical Tests", menu=statmenu) master.config(menu=menubar) """ b3 = Button(frame, text="Load traces", width=20, command=self.callback3, highlightbackground="#dcdcdc") b3.grid(row=0, column=0, columnspan=2, padx=10, pady=8, sticky=W) self.b4 = Button(frame, text="Verify traces variance", width=20, state=DISABLED, command=self.callback2, highlightbackground="#dcdcdc") self.b4.grid(row=1, padx=10, pady=8, column=0, columnspan=2) self.b5 = Button(frame, text="Plot Variance vs. current", width=20, state=DISABLED, command=self.callback5, highlightbackground="#dcdcdc") self.b5.grid(row=2, padx=10, pady=8, column=0, columnspan=2) #need to remove Pack to use separator s1 = Separator(frame, orient=VERTICAL) s1.grid(column=2, row=0, rowspan=40, pady=10, sticky=N + W + S) self.input_filename_label = StringVar() self.input_filename_label.set("No data loaded yet") self.l1 = Label(frame, textvariable=self.input_filename_label, width=40, bg="#dcdcdc") self.l1.grid(row=0, column=2, columnspan=4, pady=5) Label(frame, text="Baseline range (pts)", bg="#dcdcdc").grid(row=1, column=2, columnspan=2, pady=5, sticky=E) self.br = Entry(frame, justify=CENTER, width=5, highlightbackground="#dcdcdc") self.br.grid(row=1, column=4, sticky=W, pady=5) self.br.insert(END, '0, 50') Label(frame, text="Decimation", bg="#dcdcdc").grid(row=2, column=2, columnspan=2, pady=5, sticky=E) self.de = Entry(frame, justify=CENTER, width=5, highlightbackground="#dcdcdc") self.de.grid(row=2, column=4, sticky=W, pady=5) self.de.insert(END, '1') Label(frame, text="Unitary current amplitude (pA)", bg="#dcdcdc").grid(row=3, column=2, columnspan=2, pady=5, sticky=E) self.ua = Entry(frame, justify=CENTER, width=5, highlightbackground="#dcdcdc") self.ua.grid(row=3, column=4, sticky=W, pady=5) self.ua.insert(END, '1') #default unitary current is 1 pA Label(frame, text="Output filename", bg="#dcdcdc").grid(row=4, column=2, columnspan=2, pady=5) style = Style() style.theme_use('clam') style.configure("w.TRadiobutton", padding=2, background="#dcdcdc", foreground="black", width=15) style.configure("TRadiobutton", padding=2, background="#dcdcdc", foreground="black", width=8) MODES = [("verified.txt", 3), ("Save as...", 2), ("v_[infile]", 1), ("[date:time]_v_[infile]", 0)] self.v = IntVar() self.v.set(0) # initialize #note this is the ttk radiobutton, the tk one doesn't select at first for text, mode in MODES: b = Radiobutton(frame, text=text, command=self.callback_fname, variable=self.v, value=mode, state=NORMAL) b.grid(row=5, padx=10, column=mode + 2, sticky=E) #the last button in the loop (0) is the wide one, so gets the wide style. b.configure(style='w.TRadiobutton') self.traceHost = Frame(frame) self.traceHost.grid(row=15, column=0, columnspan=3) self.p = Plot(self.traceHost) self.Host2D = Frame(frame) self.Host2D.grid(row=15, column=3, columnspan=3) self.pcv = Plot(self.Host2D) s2 = Separator(frame) s2.grid(row=25, columnspan=6, sticky=S + E + W) message = Message(frame, text=self.introduction, width=800, font=("Courier", 12), bg="#dcdcdc") message.grid(row=26, rowspan=8, columnspan=6, sticky=EW) s3 = Separator(frame) s3.grid(row=35, columnspan=6, sticky=E + W) version_text = "https://github.com/aplested/verify\nPython version:\t" + sys.version.replace( "\n", "\t") version = Message(frame, width=800, text=version_text, justify=LEFT, background="#dcdcdc", font=("Courier", 12)) version.grid(row=36, columnspan=5, sticky=EW) self.b6 = Button(frame, text="Quit", command=master.quit, width=10, highlightbackground="#dcdcdc") self.b6.grid(row=36, padx=10, pady=8, column=5, sticky=W)