PEATDB/DNAtool/DNAtool.py
def seq_display_settings(self):
        """Dialog to change sequence display settings"""
        # Open a new window for setting the restriction enzymes

        self.seq_display_setupwin=Toplevel()
        self.seq_display_setupwin.geometry('+300+450')
        self.seq_display_setupwin.title('Sequence Display Setup')

        # Spacing between bases
        row=1
        lblspace=Label(self.seq_display_setupwin,text='Bases Spacing:')
        lblspace.grid(row=row,column=0,padx=3,pady=2)
        bscaleentry=Scale(self.seq_display_setupwin,from_=8,to=20,resolution=1,orient='horizontal',
                            relief='ridge',variable=self.base_scale,label='scale factor')
        bscaleentry.grid(row=row,column=1, sticky='wens', padx=3,pady=2)
        row=2
        lblfont=Label(self.seq_display_setupwin,text='Seq Font:')
        lblfont.grid(row=row,column=0,padx=3,pady=2)
        fontentry_button=Menubutton(self.seq_display_setupwin,textvariable=self.seqfont,
					relief=RAISED,width=16)
        restr_fontentry_button=Menubutton(self.seq_display_setupwin,textvariable=self.restr_font,
					relief=RAISED,width=16)
        fontentry_menu=Menu(fontentry_button,tearoff=0)
        restr_fontentry_menu=Menu(restr_fontentry_button,tearoff=0)
        fontentry_button['menu']=fontentry_menu
        restr_fontentry_button['menu']=restr_fontentry_menu

        # Other fonts available
        fts=['Arial','Courier','Verdana','Fixed','Times']
        for text in fts:
            #text='Font '+text
            fontentry_menu.add_radiobutton(label=text,
                                            variable=self.seqfont,
                                            value=text,
                                            indicatoron=1)
            restr_fontentry_menu.add_radiobutton(label=text,
                                            variable=self.restr_font,
                                            value=text,
                                            indicatoron=1)
        fontentry_button.grid(row=row,column=1, sticky='nes', padx=3,pady=2)

        row=3
        lblfontsize=Label(self.seq_display_setupwin,text='Sequence Font Size:')
        lblfontsize.grid(row=row,column=0,padx=3,pady=2)
        fontsizeentry=Scale(self.seq_display_setupwin,from_=8,to=20,resolution=1,orient='horizontal',
                            relief='ridge',variable=self.seqfontsize)

        fontsizeentry.grid(row=row,column=1, sticky='wens',padx=3,pady=2)
        row=4
        frame = Frame(self.seq_display_setupwin)
        fontstyle_label = Label(frame, text='Font Style:')
        fontstyle_label.grid(row=0,column=0)
        fontstyle = Radiobutton(frame, text="plain", variable=self.fontstyle, value=0)
        fontstyle1 = Radiobutton(frame, text="bold", variable=self.fontstyle, value=1)
        fontstyle2 = Radiobutton(frame, text="italic", variable=self.fontstyle, value=2)
        fontstyle.grid(row=0,column=1)
        fontstyle1.grid(row=0,column=2)
        fontstyle2.grid(row=0,column=3)
        frame.grid(row=row,column=0,columnspan=2,sticky='news', padx=3,pady=2)

        row=5
        self.backgrcolorbutton = Button(self.seq_display_setupwin, text='background color',
                                    bg=self.backgrcolor.get(),
                                    command=self.setbackgrcolor)
        self.backgrcolorbutton.grid(row=row,column=1, sticky='nes', padx=3,pady=2)
        row=6
        restrfont=Label(self.seq_display_setupwin,text='Restr. Site Font:')
        restrfont.grid(row=row,column=0,padx=3,pady=2)
        restr_fontentry_button.grid(row=row,column=1, sticky='nes', padx=3,pady=2)
        row=7

        # Apply Button
        b = Button(self.seq_display_setupwin, text="Apply Settings", command=self.update_window_formatting)
        b.grid(row=row,column=1,sticky='wens',padx=4,pady=4)

        # Close button
        c=Button(self.seq_display_setupwin,text='Close',command=self.close_seq_display_setupwin)
        c.grid(row=row,column=0,sticky='wens',padx=4,pady=4)

        # Save Settings button
        row=8
        c=Button(self.seq_display_setupwin,text='Save as Default',command=self.save_preferences)
        c.grid(row=row,column=0,columnspan=2,sticky='wens',padx=4,pady=4)
        return
Dialog to change sequence display settings
Dialog to change sequence display settings
Dialog to change sequence display settings
def seq_display_settings(self):
        self.seq_display_setupwin=Toplevel()
        self.seq_display_setupwin.geometry('+300+450')
        self.seq_display_setupwin.title('Sequence Display Setup')
        row=1
        lblspace=Label(self.seq_display_setupwin,text='Bases Spacing:')
        lblspace.grid(row=row,column=0,padx=3,pady=2)
        bscaleentry=Scale(self.seq_display_setupwin,from_=8,to=20,resolution=1,orient='horizontal',
                            relief='ridge',variable=self.base_scale,label='scale factor')
        bscaleentry.grid(row=row,column=1, sticky='wens', padx=3,pady=2)
        row=2
        lblfont=Label(self.seq_display_setupwin,text='Seq Font:')
        lblfont.grid(row=row,column=0,padx=3,pady=2)
        fontentry_button=Menubutton(self.seq_display_setupwin,textvariable=self.seqfont,
					relief=RAISED,width=16)
        restr_fontentry_button=Menubutton(self.seq_display_setupwin,textvariable=self.restr_font,
					relief=RAISED,width=16)
        fontentry_menu=Menu(fontentry_button,tearoff=0)
        restr_fontentry_menu=Menu(restr_fontentry_button,tearoff=0)
        fontentry_button['menu']=fontentry_menu
        restr_fontentry_button['menu']=restr_fontentry_menu
        fts=['Arial','Courier','Verdana','Fixed','Times']
        for text in fts:
            fontentry_menu.add_radiobutton(label=text,
                                            variable=self.seqfont,
                                            value=text,
                                            indicatoron=1)
            restr_fontentry_menu.add_radiobutton(label=text,
                                            variable=self.restr_font,
                                            value=text,
                                            indicatoron=1)
        fontentry_button.grid(row=row,column=1, sticky='nes', padx=3,pady=2)
        row=3
        lblfontsize=Label(self.seq_display_setupwin,text='Sequence Font Size:')
        lblfontsize.grid(row=row,column=0,padx=3,pady=2)
        fontsizeentry=Scale(self.seq_display_setupwin,from_=8,to=20,resolution=1,orient='horizontal',
                            relief='ridge',variable=self.seqfontsize)
        fontsizeentry.grid(row=row,column=1, sticky='wens',padx=3,pady=2)
        row=4
        frame = Frame(self.seq_display_setupwin)
        fontstyle_label = Label(frame, text='Font Style:')
        fontstyle_label.grid(row=0,column=0)
        fontstyle = Radiobutton(frame, text="plain", variable=self.fontstyle, value=0)
        fontstyle1 = Radiobutton(frame, text="bold", variable=self.fontstyle, value=1)
        fontstyle2 = Radiobutton(frame, text="italic", variable=self.fontstyle, value=2)
        fontstyle.grid(row=0,column=1)
        fontstyle1.grid(row=0,column=2)
        fontstyle2.grid(row=0,column=3)
        frame.grid(row=row,column=0,columnspan=2,sticky='news', padx=3,pady=2)
        row=5
        self.backgrcolorbutton = Button(self.seq_display_setupwin, text='background color',
                                    bg=self.backgrcolor.get(),
                                    command=self.setbackgrcolor)
        self.backgrcolorbutton.grid(row=row,column=1, sticky='nes', padx=3,pady=2)
        row=6
        restrfont=Label(self.seq_display_setupwin,text='Restr. Site Font:')
        restrfont.grid(row=row,column=0,padx=3,pady=2)
        restr_fontentry_button.grid(row=row,column=1, sticky='nes', padx=3,pady=2)
        row=7
        b = Button(self.seq_display_setupwin, text="Apply Settings", command=self.update_window_formatting)
        b.grid(row=row,column=1,sticky='wens',padx=4,pady=4)
        c=Button(self.seq_display_setupwin,text='Close',command=self.close_seq_display_setupwin)
        c.grid(row=row,column=0,sticky='wens',padx=4,pady=4)
        row=8
        c=Button(self.seq_display_setupwin,text='Save as Default',command=self.save_preferences)
        c.grid(row=row,column=0,columnspan=2,sticky='wens',padx=4,pady=4)
        return
def seq_display_settings ( self ) : self . seq_display_setupwin = Toplevel ( ) self . seq_display_setupwin . geometry ( '+300+450' ) self . seq_display_setupwin . title ( 'Sequence Display Setup' ) row = 1 lblspace = Label ( self . seq_display_setupwin , text = 'Bases Spacing:' ) lblspace . grid ( row = row , column = 0 , padx = 3 , pady = 2 ) bscaleentry = Scale ( self . seq_display_setupwin , from_ = 8 , to = 20 , resolution = 1 , orient = 'horizontal' , relief = 'ridge' , variable = self . base_scale , label = 'scale factor' ) bscaleentry . grid ( row = row , column = 1 , sticky = 'wens' , padx = 3 , pady = 2 ) row = 2 lblfont = Label ( self . seq_display_setupwin , text = 'Seq Font:' ) lblfont . grid ( row = row , column = 0 , padx = 3 , pady = 2 ) fontentry_button = Menubutton ( self . seq_display_setupwin , textvariable = self . seqfont , relief = RAISED , width = 16 ) restr_fontentry_button = Menubutton ( self . seq_display_setupwin , textvariable = self . restr_font , relief = RAISED , width = 16 ) fontentry_menu = Menu ( fontentry_button , tearoff = 0 ) restr_fontentry_menu = Menu ( restr_fontentry_button , tearoff = 0 ) fontentry_button [ 'menu' ] = fontentry_menu restr_fontentry_button [ 'menu' ] = restr_fontentry_menu fts = [ 'Arial' , 'Courier' , 'Verdana' , 'Fixed' , 'Times' ] for text in fts : fontentry_menu . add_radiobutton ( label = text , variable = self . seqfont , value = text , indicatoron = 1 ) restr_fontentry_menu . add_radiobutton ( label = text , variable = self . restr_font , value = text , indicatoron = 1 ) fontentry_button . grid ( row = row , column = 1 , sticky = 'nes' , padx = 3 , pady = 2 ) row = 3 lblfontsize = Label ( self . seq_display_setupwin , text = 'Sequence Font Size:' ) lblfontsize . grid ( row = row , column = 0 , padx = 3 , pady = 2 ) fontsizeentry = Scale ( self . seq_display_setupwin , from_ = 8 , to = 20 , resolution = 1 , orient = 'horizontal' , relief = 'ridge' , variable = self . seqfontsize ) fontsizeentry . grid ( row = row , column = 1 , sticky = 'wens' , padx = 3 , pady = 2 ) row = 4 frame = Frame ( self . seq_display_setupwin ) fontstyle_label = Label ( frame , text = 'Font Style:' ) fontstyle_label . grid ( row = 0 , column = 0 ) fontstyle = Radiobutton ( frame , text = "plain" , variable = self . fontstyle , value = 0 ) fontstyle1 = Radiobutton ( frame , text = "bold" , variable = self . fontstyle , value = 1 ) fontstyle2 = Radiobutton ( frame , text = "italic" , variable = self . fontstyle , value = 2 ) fontstyle . grid ( row = 0 , column = 1 ) fontstyle1 . grid ( row = 0 , column = 2 ) fontstyle2 . grid ( row = 0 , column = 3 ) frame . grid ( row = row , column = 0 , columnspan = 2 , sticky = 'news' , padx = 3 , pady = 2 ) row = 5 self . backgrcolorbutton = Button ( self . seq_display_setupwin , text = 'background color' , bg = self . backgrcolor . get ( ) , command = self . setbackgrcolor ) self . backgrcolorbutton . grid ( row = row , column = 1 , sticky = 'nes' , padx = 3 , pady = 2 ) row = 6 restrfont = Label ( self . seq_display_setupwin , text = 'Restr. Site Font:' ) restrfont . grid ( row = row , column = 0 , padx = 3 , pady = 2 ) restr_fontentry_button . grid ( row = row , column = 1 , sticky = 'nes' , padx = 3 , pady = 2 ) row = 7 b = Button ( self . seq_display_setupwin , text = "Apply Settings" , command = self . update_window_formatting ) b . grid ( row = row , column = 1 , sticky = 'wens' , padx = 4 , pady = 4 ) c = Button ( self . seq_display_setupwin , text = 'Close' , command = self . close_seq_display_setupwin ) c . grid ( row = row , column = 0 , sticky = 'wens' , padx = 4 , pady = 4 ) row = 8 c = Button ( self . seq_display_setupwin , text = 'Save as Default' , command = self . save_preferences ) c . grid ( row = row , column = 0 , columnspan = 2 , sticky = 'wens' , padx = 4 , pady = 4 ) return
Dialog to change sequence display settings
Dialog to change sequence display settings
"""Dialog to change sequence display settings""" # Open a new window for setting the restriction enzymes # Spacing between bases # Other fonts available #text='Font '+text # Apply Button # Close button # Save Settings button
self