PEATDB/PEATApp.py
def createRecsOptsMenu(self, parent, callback=None):
        """Get an option menu with a list of the records"""
        def setref(evt=None):
            prot = var.get()
            if self.DB[prot].Structure == None:
                tkMessageBox.showinfo("Warning",
                                     'There is no structure for this record! '
                                      'You should add one.')
            self.DB.meta.refprotein = prot
        if not hasattr(self.DB.meta, 'refprotein'):
            self.DB.meta.refprotein = None

        var=StringVar()
        var.set(self.DB.meta.refprotein)
        o = Menubutton(parent, textvariable=var,
                            borderwidth=2,relief=GROOVE,
                            bg='#ccFFFF',
                            width=12)
        m=Menu(o,tearoff=0)
        o['menu']=m
        p=0
        for name in self.DB.getRecs():
            if p%30==0 and p!=0:
                colbrk=1
            else:
                colbrk=0
            m.add_radiobutton(label=name,
                              value=name,
                              variable=var,
                              columnbreak=colbrk,
                              command=setref)
            p+=1
        return o
Get an option menu with a list of the records
Get an option menu with a list of the records
Get an option menu with a list of the records
def createRecsOptsMenu(self, parent, callback=None):
        def setref(evt=None):
            prot = var.get()
            if self.DB[prot].Structure == None:
                tkMessageBox.showinfo("Warning",
                                     'There is no structure for this record! '
                                      'You should add one.')
            self.DB.meta.refprotein = prot
        if not hasattr(self.DB.meta, 'refprotein'):
            self.DB.meta.refprotein = None
        var=StringVar()
        var.set(self.DB.meta.refprotein)
        o = Menubutton(parent, textvariable=var,
                            borderwidth=2,relief=GROOVE,
                            bg='#ccFFFF',
                            width=12)
        m=Menu(o,tearoff=0)
        o['menu']=m
        p=0
        for name in self.DB.getRecs():
            if p%30==0 and p!=0:
                colbrk=1
            else:
                colbrk=0
            m.add_radiobutton(label=name,
                              value=name,
                              variable=var,
                              columnbreak=colbrk,
                              command=setref)
            p+=1
        return o
def createRecsOptsMenu ( self , parent , callback = None ) : def setref ( evt = None ) : prot = var . get ( ) if self . DB [ prot ] . Structure == None : tkMessageBox . showinfo ( "Warning" , 'There is no structure for this record! ' 'You should add one.' ) self . DB . meta . refprotein = prot if not hasattr ( self . DB . meta , 'refprotein' ) : self . DB . meta . refprotein = None var = StringVar ( ) var . set ( self . DB . meta . refprotein ) o = Menubutton ( parent , textvariable = var , borderwidth = 2 , relief = GROOVE , bg = '#ccFFFF' , width = 12 ) m = Menu ( o , tearoff = 0 ) o [ 'menu' ] = m p = 0 for name in self . DB . getRecs ( ) : if p % 30 == 0 and p != 0 : colbrk = 1 else : colbrk = 0 m . add_radiobutton ( label = name , value = name , variable = var , columnbreak = colbrk , command = setref ) p += 1 return o
Get an option menu with a list of the records
Get an option menu with a list of the records
"""Get an option menu with a list of the records"""
self
parent
callback