本文整理汇总了Python中tkinter.OptionMenu.config方法的典型用法代码示例。如果您正苦于以下问题:Python OptionMenu.config方法的具体用法?Python OptionMenu.config怎么用?Python OptionMenu.config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tkinter.OptionMenu
的用法示例。
在下文中一共展示了OptionMenu.config方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
self.info = None
eframe = self.eframe = LabelFrame(self,text="Options")
#,fg=textLightColor,bg=baseColor)
eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
label = Label(eframe,text="Pipeline:")#,fg=textLightColor,bg=baseColor)
label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
Pipelines=["InitialChIPseqQC", "ChIPseq" ]
Pipeline = self.Pipeline = StringVar()
Pipeline.set(Pipelines[0])
om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
om.config()#bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
#om.pack(side=LEFT,padx=20,pady=5)
om.grid(row=3,column=1,sticky=W,padx=20,pady=5)
readtypes = ['Single', 'Paired']
self.readtype = readtype = StringVar()
readtype.set(readtypes[0])
readtype_menu = OptionMenu(eframe, readtype, *readtypes)
readtype_menu.grid(row=3, column=3, sticky=E, pady=5)
readtype_label = Label(eframe, text="-end ")
readtype_label.grid( row=3, column=4, stick=W, pady=5)
self.add_info(eframe)
self.option_controller()
self.peakinfo_fn = 'peakcall.tab'
self.contrast_fn = 'contrast.tab'
示例2: __init__
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
self.pairs = None
eframe = self.eframe = LabelFrame(self,text="Options")
#,fg=textLightColor,bg=baseColor)
eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
label = Label(eframe,text="Pipeline")#,fg=textLightColor,bg=baseColor)
label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
PipelineLabels = ['Initial QC',
'Germline',
'Somatic Tumor-Normal',
'Somatic Tumor-Only']
Pipelines=["initialqcgenomeseq",
"wgslow",
'wgs-somatic',
'wgs-somatic-tumoronly']
self.label2pipeline = { k:v for k,v in zip(PipelineLabels, Pipelines)}
PipelineLabel = self.PipelineLabel = StringVar()
Pipeline = self.Pipeline = StringVar()
PipelineLabel.set(PipelineLabels[0])
#om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
om = OptionMenu(eframe, PipelineLabel, *PipelineLabels, command=self.option_controller)
om.config()#bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
#om.pack(side=LEFT,padx=20,pady=5)
om.grid(row=3,column=1,sticky=W,padx=10,pady=5)
示例3: __init__
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
self.pairs = None
eframe = self.eframe = LabelFrame(self,text="Options")
#,fg=textLightColor,bg=baseColor)
eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
label = Label(eframe,text="Pipeline")#,fg=textLightColor,bg=baseColor)
label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
Pipelines=["initialqcgenomeseq","wgslow"]
Pipeline = self.Pipeline = StringVar()
Pipeline.set(Pipelines[0])
om = OptionMenu(eframe, Pipeline, *Pipelines, command=self.option_controller)
om.config()#bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
#om.pack(side=LEFT,padx=20,pady=5)
om.grid(row=3,column=1,sticky=W,padx=10,pady=5)
示例4: init_project_frame
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
def init_project_frame( self ) :
projframe = Frame(self)
######################
#The Project Entry Form
#
#Current design inherited from others
#is very bad. It should have been made as
#json or dictionary as is in this point
#then the subsequent coding will be much
#eaiser.
#BK
######################
BS=StringVar()
self.eprojectid = eprojectid= StringVar()
self.eorganism = eorganism=StringVar()
self.eanalyst = eanalyst=StringVar()
self.epoc = epoc=StringVar()
self.epi = epi=StringVar()
self.euser = euser=StringVar()
self.eflowcell = eflowcell=StringVar()
self.eplatform = eplatform=StringVar()
eplatform.set("Illumina")
self.technique = technique=StringVar()
self.pipehome = pipehome=StringVar()
pipehome.set(PIPELINER_HOME)
editframe = Frame( self )
editframe.grid( column=0, row=3, columnspan=3 )
projpanel1 = LabelFrame(editframe,text="Project Information")
#,fg=textLightColor,bg=baseColor)
projpanel1.pack( side = TOP, fill=X, padx=10, pady=5, expand=YES )
pipeline_panel = LabelFrame(editframe, text="Global Settings")
pipeline_panel.pack( side=TOP, fill=X, padx=10, pady=5, expand=YES )
l=Label( pipeline_panel, text="Genome:" )
l.grid(row=1,column=3,sticky=W,padx=0,pady=5)
l = Label( pipeline_panel, text="Pipeline Family:" )
l.grid(row=1,column=1,sticky=W,padx=0,pady=5)
annotations=['hg19','mm10','mm9','hg38','GRCh38']
self.annotation = annotation = StringVar()
annotation.set(annotations[0])
#annotation.trace('w', lambda *_ :settargets(annotation) )
om = OptionMenu(pipeline_panel, annotation, *annotations, command=self.set_pipeline)
#, command=lambda _:makejson("refsets"))
om.config() #bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config() #bg = widgetBgColor,fg=widgetFgColor)
om.grid(row=1,column=4,sticky=W,padx=10,pady=10)
pfamilys = ['exomeseq', 'rnaseq', 'genomeseq', 'mirseq', 'ChIPseq', 'scrnaseq']
self.pfamily = pfamily = StringVar()
pfamily.set('Select a pipeline')
om = OptionMenu(pipeline_panel, pfamily, *pfamilys, command=self.set_pipeline)
#, command=lambda _:makejson(pfamily.get()))
om.config() #bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config() #bg = widgetBgColor,fg=widgetFgColor)
om.grid(row=1,column=2,sticky=W,padx=10,pady=5)
#add_button = Button( pipeline_panel,
# text="Set a pipeline",
# command=self.add_pipeline
# )
#add_button.grid(row=1, column=5, sticky=W, padx=10, pady=5)
self.notebook = notebook = Notebook( editframe )
self.pipelineframe = None #the pipeline frame in the notebook frame!
projpanel2 = Frame(notebook) #,fg=textLightColor,bg=baseColor)
projpanel2.pack( side = LEFT, fill=BOTH, padx=10, pady=5, expand=YES )
notebook.add( projpanel2, text="Project Description" )
notebook.pack( side=LEFT, fill=BOTH, padx=10, pady=5, expand=YES )
Dscrollbar = Scrollbar(projpanel2)
Dscrollbar.grid(row=2,column=4,rowspan=40)
self.description =description= Text(projpanel2,
width=75,
height=28,
#bg=commentBgColor,
#fg=commentFgColor,
font=("nimbus mono bold","10"),
yscrollcommand = Dscrollbar.set)
description.delete("1.0", END)
description.insert(INSERT, "Enter CCBR Project Description and Notes here.")
#description.bind('<FocusOut>',lambda _:makejson("none"))
description.grid(row=2,column=3,sticky="e",padx=10,pady=5)
Dscrollbar['command']=description.yview
L=Label(projpanel1, text="Project Id", anchor="ne" )
#,bg=baseColor,fg=textLightColor)
E = Entry(projpanel1,
bd =2,
width=20,
#bg=entryBgColor,
#fg=entryFgColor,
#.........这里部分代码省略.........
示例5: Frontend
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
class Frontend():
def __init__(self,x,y,b):
self.x=str(x) #1600
self.y=str(y) #900
self.pressed=0
self.b=10
self.c=30
self.grapher=0
self.graph=[0,0,0,0]
self.root=b
def startwindow(self):
# self.root=Tk()
a=str(self.x+'x'+self.y)
self.root.title('Wahrscheinlichkeinten & Simulation')
self.root.geometry(a)
self.g=Label(self.root,bg='white')
self.g.place(x=0,y=0,width=self.x,height=self.y)
# self.g.bind('<1>',self.optioncanged)
self.lst1 = ['Marriage','Atom','BubbleGum','House_of_Cards','Lotto','SecretSanta','Coins']
self.var1 = StringVar(self.root)
self.var1.set('Marriage')
self.drop = OptionMenu(self.root,self.var1,*self.lst1)
self.drop.config(font=('Arial',(30)),bg='white')
self.drop['menu'].config(font=('calibri',(20)),bg='white')
self.drop.pack(side=TOP)
self.photo = PhotoImage(file='z1.gif')
self.label = Label(image=self.photo,borderwidth=0)
self.label.image = self.photo
self.label.bind('<1>',self.MouseOneDown)
self.label.place(y=0,x=int(self.x)-200)
self.startbutton=Button(self.root,text='Start',font=('Arial',40),bg='#B4045F',borderwidth=5,command=self.startpressed)
self.startbutton.place(x=0,y=int(self.y)-100,width=int(self.y)-200,height=100)
self.csvbutton=Button(self.root,text='Export CSV',font=('Arial',40),bg='green',borderwidth=5,command=self.csvpressed)
self.csvbutton.place(x=int(self.x)/2+50,y=int(self.y)-100,width=int(self.y)-230,height=100)
def startpressed(self):
if self.grapher==1:
for x in range(len(self.graph)):
if self.graph[x]!=0:
self.graph[x].destroy()
self.grapher=0
self.root.update()
a=self.var1.get()
if self.pressed==1:
try:
self.b=int(self.changer0.get('1.0','end-1c'))
except (AttributeError,TclError,ValueError):
self.b=10
try:
self.c=self.changer2.get('1.0','end-1c')
except (AttributeError,TclError,ValueError):
self.c=1
if a=='Marriage':
self.run0=Marriage(self.b)
self.run0.DEBUG=False
self.run0.sim()
elif a=='Atom':
self.c=float(self.c)
self.run1=Atom(self.c,self.b)
self.run1.DEBUG=False
self.run1.sim()
elif a=='BubbleGum':
self.run2=BubbleGum(self.b)
self.run2.DEBUG=False
self.run2.sim()
self.grapher=1
self.graph=[0,0]
g=str(round(self.run2.getrel()[0],4))
h=str(round(self.run2.getrel()[1],4))
self.graph[0]=Label(self.root,bg='white',text='Durchschnitt Karten zu viel: '+g,font=('calibri',19))
self.graph[0].place(x=10,y=450)
self.graph[1]=Label(self.root,bg='white',text='Durchschnitt dass es passiert: '+h,font=('calibri',19))
self.graph[1].place(x=10,y=500)
elif a=='House_of_Cards':
if self.c=='':
self.c=0
else:
self.c=int(self.c)
self.run3=House_of_Cards(self.b,self.c)
self.run3.DEBUG=False
self.run3.sim()
self.grapher=1
self.graph=[0]
self.graph[0]=Label(self.root,bg='white',text=('Durchschnitt: '+str(round(self.run3.getrel(),4))),font=('calibri',19))
self.graph[0].place(x=10,y=450)
elif a=='Lotto':
self.run4=Lotto(self.b)
self.run4.DEBUG=False
self.run4.sim()
x=4
y=1
count=0
self.graph=[0,0,0,0]
self.grapher=1
self.graph[0]=Label(self.root,bg='black')
self.graph[0].place(x=10,width=10+(int(self.x)*0.8),height=1,y=int(self.y)-int(self.y)/4*0.5-350)
self.graph[1]=Label(self.root,text='50%',bg='white',font=('calibri',10))
self.graph[1].place(x=60+(int(self.x)*0.8),width=50,height=50,y=int(self.y)-int(self.y)/4*0.5-375)
self.graph[2]=Label(self.root,bg='black')
self.graph[2].place(x=10,width=20,height=1,y=int(self.y)-350)
self.graph[3]=Label(self.root,bg='black')
#.........这里部分代码省略.........
示例6: __init__
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
self.info = None
eframe = self.eframe = LabelFrame(self,text="Options")
#,fg=textLightColor,bg=baseColor)
eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
label = Label(eframe,text="Pipeline")#,fg=textLightColor,bg=baseColor)
label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
PipelineLabels=["CellRanger","Initial/QC","Clustering","Multi-Sample Clustering" ]
Pipelines=["cellranger","scrnaseqinit","scrnaseqcluster", "scrnaseqmulticluster"]
self.label2pipeline = { k:v for k,v in zip(PipelineLabels, Pipelines)}
PipelineLabel = self.PipelineLabel = StringVar()
self.Pipeline = StringVar()
PipelineLabel.set(PipelineLabels[0])
om = OptionMenu(eframe, PipelineLabel, *PipelineLabels, command=self.option_controller)
om.config()#bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
#om.pack(side=LEFT,padx=20,pady=5)
om.grid(row=3,column=1,sticky=W,padx=10,pady=5)
self.crOpts = crOpts = LabelFrame( eframe,
text="CellRanger Settings" )
self.scrCRID = scrCRID = StringVar()
scrCRID.set("SPECIFY_PREFIX_HERE")
self.scrExpected = scrExpected = StringVar()
scrExpected.set("3000")
scrcridL = Label(crOpts, text="CellRanger Sample ID: ")
scrcridE = Entry(crOpts, bd =2, width=25, textvariable=scrCRID)
scrcridL.grid(row=9,column=1,sticky=W,padx=10,pady=5)
scrcridE.grid(row=9,column=2,sticky=W,padx=0,pady=5)
screxpectedL = Label(crOpts, text="Expected number of cells: ")
screxpectedE = Entry(crOpts, bd =2, width=8, textvariable=scrExpected)
screxpectedL.grid(row=10,column=1,sticky=W,padx=10,pady=5)
screxpectedE.grid(row=10,column=2,sticky=W,padx=0,pady=5)
self.clusterOpts = clusterOpts = LabelFrame( eframe,
text="Clustering and tSNE Options" )
self.scrPCs = scrPCs = StringVar()
scrPCs.set("12")
self.scrRes = scrRes = StringVar()
scrRes.set("0.6")
#scrPCs.trace('w', lambda a,b,c,x="scrPCs": makejson(x))
#Filter out genes < [5] read counts in < [2] samples
scrpcsL = Label(clusterOpts, text="Include principal components 1 through ")
scrpcsE = Entry(clusterOpts, bd =2, width=3, textvariable=scrPCs)
scrresL = Label(clusterOpts, text="with clustering resolution: ")
scrresE = Entry(clusterOpts, bd =2, width=3, textvariable=scrRes)
scrpcsL.grid(row=9,column=1,sticky=W,padx=10,pady=5)
scrpcsE.grid(row=9,column=2,sticky=W,padx=0,pady=5)
scrresL.grid(row=9,column=3,sticky=W,padx=5,pady=5)
scrresE.grid(row=9,column=4,sticky=W,padx=0,pady=5)
#scrRes.trace('w', lambda a,b,c,x="scrPCs": makejson(x))
clusterOpts.grid( row=8, column=0, columnspan=4, sticky=W, padx=20, pady=10 )
self.multiclusterOpts = multiclusterOpts = LabelFrame( eframe,
text = "Multi-Sample Clustering and tSNE Options")
scrccsL = Label(multiclusterOpts, text="Include canonical components 1 through ")
scrccsE = Entry(multiclusterOpts, bd =2, width=3, textvariable=scrPCs)
scrmcresL = Label(multiclusterOpts, text="with clustering resolution: ")
scrmcresE = Entry(multiclusterOpts, bd =2, width=3, textvariable=scrRes)
scrccsL.grid(row=9,column=1,sticky=W,padx=10,pady=5)
scrccsE.grid(row=9,column=2,sticky=W,padx=0,pady=5)
scrmcresL.grid(row=9,column=3,sticky=W,padx=5,pady=5)
scrmcresE.grid(row=9,column=4,sticky=W,padx=0,pady=5)
self.qcOpts = qcOpts = LabelFrame( eframe,
text="Initial Settings" )
countL = Label( qcOpts, text="Counts/Matrix Dir:" )
countL.grid(row=9, column=1, sticky=W, padx=10, pady=5 )
countpath=StringVar()
self.countpath = countpath
count_entry = Entry(qcOpts,
bd =2,
width = 50,
#bg = entryBgColor,
#fg = entryFgColor,
textvariable = countpath, state='normal'
)
count_entry.grid( row=9, column=2, columnspan=3 )
self.count_button = count_button = Button( qcOpts,
text="Open Directory",
command=self.set_count_directory )
count_button.grid( row=9, column=5 )
#.........这里部分代码省略.........
示例7: __init__
# 需要导入模块: from tkinter import OptionMenu [as 别名]
# 或者: from tkinter.OptionMenu import config [as 别名]
def __init__(self, pipepanel, pipeline_name, *args, **kwargs) :
PipelineFrame.__init__(self, pipepanel, pipeline_name, *args, **kwargs)
self.info = None
eframe = self.eframe = LabelFrame(self,text="Options")
#,fg=textLightColor,bg=baseColor)
eframe.grid( row=5, column=1, sticky=W, columnspan=7, padx=10, pady=5 )
label = Label(eframe,text="Pipeline")#,fg=textLightColor,bg=baseColor)
label.grid(row=3,column=0,sticky=W,padx=10,pady=5)
PipelineLabels=["CellRanger","Initial/QC","Clustering" ]
Pipelines=["cellranger","scrnaseqinit","scrnaseqcluster"]
self.label2pipeline = { k:v for k,v in zip(PipelineLabels, Pipelines)}
PipelineLabel = self.PipelineLabel = StringVar()
self.Pipeline = StringVar()
PipelineLabel.set(PipelineLabels[0])
om = OptionMenu(eframe, PipelineLabel, *PipelineLabels, command=self.option_controller)
om.config()#bg = widgetBgColor,fg=widgetFgColor)
om["menu"].config()#bg = widgetBgColor,fg=widgetFgColor)
#om.pack(side=LEFT,padx=20,pady=5)
om.grid(row=3,column=1,sticky=W,padx=10,pady=5)
self.crOpts = crOpts = LabelFrame( eframe,
text="CellRanger Settings" )
self.scrCRID = scrCRID = StringVar()
scrCRID.set("SPECIFY_PREFIX_HERE")
self.scrExpected = scrExpected = StringVar()
scrExpected.set("3000")
scrcridL = Label(crOpts, text="CellRanger Sample ID: ")
scrcridE = Entry(crOpts, bd =2, width=25, textvariable=scrCRID)
scrcridL.grid(row=9,column=1,sticky=W,padx=10,pady=5)
scrcridE.grid(row=9,column=2,sticky=W,padx=0,pady=5)
screxpectedL = Label(crOpts, text="Expected number of cells: ")
screxpectedE = Entry(crOpts, bd =2, width=8, textvariable=scrExpected)
screxpectedL.grid(row=10,column=1,sticky=W,padx=10,pady=5)
screxpectedE.grid(row=10,column=2,sticky=W,padx=0,pady=5)
self.clusterOpts = clusterOpts = LabelFrame( eframe,
text="Clustering and tSNE Options" )
self.scrPCs = scrPCs = StringVar()
scrPCs.set("12")
self.scrRes = scrRes = StringVar()
scrRes.set("0.6")
#scrPCs.trace('w', lambda a,b,c,x="scrPCs": makejson(x))
#Filter out genes < [5] read counts in < [2] samples
scrpcsL = Label(clusterOpts, text="Include principal components 1 through ")
scrpcsE = Entry(clusterOpts, bd =2, width=3, textvariable=scrPCs)
scrresL = Label(clusterOpts, text="with clustering resolution: ")
scrresE = Entry(clusterOpts, bd =2, width=3, textvariable=scrRes)
scrpcsL.grid(row=9,column=1,sticky=W,padx=10,pady=5)
scrpcsE.grid(row=9,column=2,sticky=W,padx=0,pady=5)
scrresL.grid(row=9,column=3,sticky=W,padx=5,pady=5)
scrresE.grid(row=9,column=4,sticky=W,padx=0,pady=5)
#scrRes.trace('w', lambda a,b,c,x="scrPCs": makejson(x))
clusterOpts.grid( row=8, column=0, columnspan=4, sticky=W, padx=20, pady=10 )
self.qcOpts = qcOpts = LabelFrame( eframe,
text="Initial Settings" )
countL = Label( qcOpts, text="Counts/Matrix Dir:" )
countL.grid(row=9, column=1, sticky=W, padx=10, pady=5 )
countpath=StringVar()
self.countpath = countpath
count_entry = Entry(qcOpts,
bd =2,
width = 50,
#bg = entryBgColor,
#fg = entryFgColor,
textvariable = countpath, state='normal'
)
count_entry.grid( row=9, column=2, columnspan=3 )
self.count_button = count_button = Button( qcOpts,
text="Open Directory",
command=self.set_count_directory )
count_button.grid( row=9, column=5 )
#####################
self.option_controller()