当前位置: 首页>>代码示例>>Python>>正文


Python Label.config方法代码示例

本文整理汇总了Python中ttk.Label.config方法的典型用法代码示例。如果您正苦于以下问题:Python Label.config方法的具体用法?Python Label.config怎么用?Python Label.config使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ttk.Label的用法示例。


在下文中一共展示了Label.config方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initUI

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
 def initUI(self):
   
     self.parent.title("Review")
     self.pack(fill=BOTH, expand=True)
     labelfont20 = ('Roboto', 20, 'bold')
     labelfont12 = ('Roboto', 12, 'bold')
     
     frame0 = Frame(self)
     frame0.pack()
     
     lbl0 = Label(frame0, text="Hi USER")
     lbl0.config(font=labelfont20)    
     lbl0.pack( padx=5, pady=5)
     lbl00 = Label(frame0, text="Search here")
     lbl00.config(font=labelfont12)
     lbl00.pack( padx=5, pady=5)
     
     
     frame1 = Frame(self)
     frame1.pack()
     
     lbl1 = Label(frame1, text="min %", width=9)
     lbl1.pack(side=LEFT, padx=7, pady=5)           
    
     self.entry1 = Entry(frame1,width=20)
     self.entry1.pack(padx=5, expand=True)
     
     
     
     
     
     frame6 = Frame(self)
     frame6.pack()
     closeButton = Button(frame6, text="Get Names",width=12,command=self.getDate)
     closeButton.pack(padx=5, pady=5)
     
     frame7 = Frame(self)
     frame7.pack()
     closeButton1 = Button(frame7, text="Open in excel",width=15,command=self.openDate)
     closeButton1.pack(padx=5, pady=5)
     
     
     
     frame000 = Frame(self)
     frame000.pack()
     self.lbl000= Label(frame000, text=" ")
     self.lbl000.config(font=labelfont12)    
     self.lbl000.pack( padx=5, pady=5)
     
     frame00a = Frame(self)
     frame00a.pack()
     self.lbl00a= Label(frame000, text=" ")
     self.lbl00a.pack( padx=5, pady=5)
开发者ID:nakulrathore,项目名称:CSV_Play,代码行数:55,代码来源:SearchCSV.py

示例2: AudioFader

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
class AudioFader(Frame):
    def __init__(self, master, get_gain, set_gain, label=''):
        Frame.__init__(self, master, width=FADER_WIDTH, height=FADER_HEIGHT)
        self.get_gain = get_gain
        self._set_gain = set_gain

        if isinstance(label, StringVar):
            Label(self, textvar=label, width=15).pack()
        else:
            Label(self, text=label, width=15).pack()
        self.gain_label = Label(self)

        gain_scale = Scale(self, from_=1, to=0, command=self.set_gain, orient='vertical')
        gain_scale.set(self.get_gain())
        gain_scale.pack()

        self.gain_label.pack()

    def set_gain(self, value):
        gain = float(value)
        self._set_gain(gain)
        self.gain_label.config(text='%1.2f' % gain)
开发者ID:ladsmund,项目名称:msp_group_project,代码行数:24,代码来源:mixer_gui.py

示例3: MainControlFrame

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
class MainControlFrame(Frame):
    def __init__(self, master, sequencer):
        Frame.__init__(self, master)
        self.sequencer = sequencer

        self.control_label = Label(self, text="Control")

        self.start_button = Button(self, text="Start")
        self.stop_button = Button(self, text="Stop")

        self.start_button.config(command=self.sequencer.play)
        self.stop_button.config(command=self.sequencer.stop)

        self.control_label.pack()
        self.start_button.pack()
        self.stop_button.pack()

        Label(self, text='Tempo').pack()
        self.tempo_label = Label(self)
        self.tempo_label.pack()

        def set_tempo(v):
            tempo = float(v)
            self.sequencer.set_speed(tempo)
            self.tempo_label.config(text='%3.0f' % tempo)

        tempo_scale = Scale(self, from_=400, to=5, command=set_tempo, orient='vertical')
        tempo_scale.set(self.sequencer.speed)
        tempo_scale.pack()

        measure_control_frame = Frame(self)
        measure_control_frame.pack()

        self.measure_resolution = StringVar(measure_control_frame)
        self.measure_resolution.set(self.sequencer.measure_resolution)
        self.beats_per_measure = StringVar(measure_control_frame)
        self.beats_per_measure.set(self.sequencer.beats_per_measure)

        Label(measure_control_frame, text='Resolution').grid(row=0, column=0, sticky='E')
        measure_resolution_entry = Entry(measure_control_frame, textvariable=self.measure_resolution, width=3)
        measure_resolution_entry.grid(row=0, column=1)

        Label(measure_control_frame, text='Beats').grid(row=1, column=0, sticky='E')
        beats_per_measure_entry = Entry(measure_control_frame, textvariable=self.beats_per_measure, width=3)
        beats_per_measure_entry.grid(row=1, column=1)

        change_measure_update = Button(measure_control_frame, text='Update Measure', command=self.change_measures)
        change_measure_update.grid(row=2, columnspan=2)

        # master_fader = mixer_frame.AudioFader(self, sequencer.getVolume, sequencer.setVolume)
        # master_fader.pack()

    def start_stop(self, event=None):
        if self.sequencer.running:
            self.sequencer.play()
        else:
            self.sequencer.stop()

    def change_measures(self):

        old_measure_resolution = self.sequencer.measure_resolution
        old_beats_per_measure = self.sequencer.beats_per_measure

        try:
            measure_resolution = int(self.measure_resolution.get())
            beats_per_measure = int(self.beats_per_measure.get())

            self.sequencer.change_measures(beats_per_measure, measure_resolution)
            print "ready to reload seq"
            self.master.master._open_sequencer(self.sequencer)
        except Exception as e:
            print e
            self.measure_resolution.set(old_measure_resolution)
            self.beats_per_measure.set(old_beats_per_measure)
            pass
开发者ID:ladsmund,项目名称:msp_group_project,代码行数:77,代码来源:sequencer_frame.py

示例4: Example

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
class Example(Frame):
  
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent
        
        self.initUI()
        
        
    def initUI(self):
   
      
        self.parent.title("Append Data")
        self.pack(fill=BOTH, expand=True)
        labelfont20 = ('Roboto', 15, 'bold')
        labelfont10 = ('Roboto', 10, 'bold')
        labelfont8 = ('Roboto', 8, 'bold')
        
        frame0 = Frame(self)
        frame0.pack()
        
        lbl0 = Label(frame0, text="Hi Nakul")
        lbl0.config(font=labelfont20)    
        lbl0.pack( padx=5, pady=5)
        lbl00 = Label(frame0, text="Fill the data here")
        lbl00.config(font=labelfont10)
        lbl00.pack( padx=5, pady=5)
        
        ####################################
        frame1 = Frame(self)
        frame1.pack()
        frame1.place(x=50, y=100)        
        
        lbl1 = Label(frame1, text="Name", width=15)
        lbl1.pack(side=LEFT,padx=7, pady=5) 
             
        self.entry1 = Entry(frame1,width=20)
        self.entry1.pack(padx=5, expand=True)
    
        ####################################
        frame2 = Frame(self)
        frame2.pack()
        frame2.place(x=50, y=130)
        
        lbl2 = Label(frame2, text="F Name", width=15)
        lbl2.pack(side=LEFT, padx=7, pady=5)

        self.entry2 = Entry(frame2)
        self.entry2.pack(fill=X, padx=5, expand=True)
        
        ######################################
        frame3 = Frame(self)
        frame3.pack()
        frame3.place(x=50, y=160)
        
        lbl3 = Label(frame3, text="DOB(D/M/Y)", width=15)
        lbl3.pack(side=LEFT, padx=7, pady=5)        

        self.entry3 = Entry(frame3)
        self.entry3.pack(fill=X, padx=5, expand=True) 
        
        #######################################
        frame4 = Frame(self)
        frame4.pack()
        frame4.place(x=50, y=190)
        
        lbl4 = Label(frame4, text="Medium(H/E)", width=15)
        lbl4.pack(side=LEFT, padx=7, pady=5)        

        self.entry4 = Entry(frame4)
        self.entry4.pack(fill=X, padx=5, expand=True)
        
        ##########################################
        frame5 = Frame(self)
        frame5.pack()
        frame5.place(x=50, y=225)  
        MODES = [
            ("M", "Male"),
            ("F", "Female"),
            ]
        lbl5 = Label(frame5, text="Gender", width=15)
        lbl5.pack(side=LEFT, padx=7, pady=5)

        global v
        v = StringVar()
        v.set("Male") # initialize

        for text, mode in MODES:
            b = Radiobutton(frame5, text=text,variable=v, value=mode)
            b.pack(side=LEFT,padx=10)
        
        ############################################
        #####printing line
        lbl5a = Label(text="___________________________________________________")
        lbl5a.pack()
        lbl5a.place(x=45, y=255)  
        
        ############################################
        frame6 = Frame(self)
#.........这里部分代码省略.........
开发者ID:nakulrathore,项目名称:OpenPyXL_Play,代码行数:103,代码来源:AppendXL.py

示例5: initUI

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
    def initUI(self):
   
      
        self.parent.title("Append Data")
        self.pack(fill=BOTH, expand=True)
        labelfont20 = ('Roboto', 15, 'bold')
        labelfont10 = ('Roboto', 10, 'bold')
        labelfont8 = ('Roboto', 8, 'bold')
        
        frame0 = Frame(self)
        frame0.pack()
        
        lbl0 = Label(frame0, text="Hi Nakul")
        lbl0.config(font=labelfont20)    
        lbl0.pack( padx=5, pady=5)
        lbl00 = Label(frame0, text="Fill the data here")
        lbl00.config(font=labelfont10)
        lbl00.pack( padx=5, pady=5)
        
        ####################################
        frame1 = Frame(self)
        frame1.pack()
        frame1.place(x=50, y=100)        
        
        lbl1 = Label(frame1, text="Name", width=15)
        lbl1.pack(side=LEFT,padx=7, pady=5) 
             
        self.entry1 = Entry(frame1,width=20)
        self.entry1.pack(padx=5, expand=True)
    
        ####################################
        frame2 = Frame(self)
        frame2.pack()
        frame2.place(x=50, y=130)
        
        lbl2 = Label(frame2, text="F Name", width=15)
        lbl2.pack(side=LEFT, padx=7, pady=5)

        self.entry2 = Entry(frame2)
        self.entry2.pack(fill=X, padx=5, expand=True)
        
        ######################################
        frame3 = Frame(self)
        frame3.pack()
        frame3.place(x=50, y=160)
        
        lbl3 = Label(frame3, text="DOB(D/M/Y)", width=15)
        lbl3.pack(side=LEFT, padx=7, pady=5)        

        self.entry3 = Entry(frame3)
        self.entry3.pack(fill=X, padx=5, expand=True) 
        
        #######################################
        frame4 = Frame(self)
        frame4.pack()
        frame4.place(x=50, y=190)
        
        lbl4 = Label(frame4, text="Medium(H/E)", width=15)
        lbl4.pack(side=LEFT, padx=7, pady=5)        

        self.entry4 = Entry(frame4)
        self.entry4.pack(fill=X, padx=5, expand=True)
        
        ##########################################
        frame5 = Frame(self)
        frame5.pack()
        frame5.place(x=50, y=225)  
        MODES = [
            ("M", "Male"),
            ("F", "Female"),
            ]
        lbl5 = Label(frame5, text="Gender", width=15)
        lbl5.pack(side=LEFT, padx=7, pady=5)

        global v
        v = StringVar()
        v.set("Male") # initialize

        for text, mode in MODES:
            b = Radiobutton(frame5, text=text,variable=v, value=mode)
            b.pack(side=LEFT,padx=10)
        
        ############################################
        #####printing line
        lbl5a = Label(text="___________________________________________________")
        lbl5a.pack()
        lbl5a.place(x=45, y=255)  
        
        ############################################
        frame6 = Frame(self)
        frame6.pack()
        frame6.place(x=50, y=290)
        
        lbl6 = Label(frame6, text="Phone No:", width=15)
        lbl6.pack(side=LEFT, padx=7, pady=5)        

        self.entry6 = Entry(frame6)
        self.entry6.pack(fill=X, padx=5, expand=True)
        
        ################################################
#.........这里部分代码省略.........
开发者ID:nakulrathore,项目名称:OpenPyXL_Play,代码行数:103,代码来源:AppendXL.py

示例6: Example

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
class Example(Frame):
  
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent
        
        self.initUI()
        
        
    def initUI(self):
      
        self.parent.title("Review")
        self.pack(fill=BOTH, expand=True)
        labelfont20 = ('Roboto', 20, 'bold')
        labelfont12 = ('Roboto', 12, 'bold')
        
        frame0 = Frame(self)
        frame0.pack()
        
        lbl0 = Label(frame0, text="Hi USER")
        lbl0.config(font=labelfont20)    
        lbl0.pack( padx=5, pady=5)
        lbl00 = Label(frame0, text="Search here")
        lbl00.config(font=labelfont12)
        lbl00.pack( padx=5, pady=5)
        
        
        frame1 = Frame(self)
        frame1.pack()
        
        lbl1 = Label(frame1, text="min %", width=9)
        lbl1.pack(side=LEFT, padx=7, pady=5)           
       
        self.entry1 = Entry(frame1,width=20)
        self.entry1.pack(padx=5, expand=True)
        
        
        
        
        
        frame6 = Frame(self)
        frame6.pack()
        closeButton = Button(frame6, text="Get Names",width=12,command=self.getDate)
        closeButton.pack(padx=5, pady=5)
        
        frame7 = Frame(self)
        frame7.pack()
        closeButton1 = Button(frame7, text="Open in excel",width=15,command=self.openDate)
        closeButton1.pack(padx=5, pady=5)
        
        
        
        frame000 = Frame(self)
        frame000.pack()
        self.lbl000= Label(frame000, text=" ")
        self.lbl000.config(font=labelfont12)    
        self.lbl000.pack( padx=5, pady=5)
        
        frame00a = Frame(self)
        frame00a.pack()
        self.lbl00a= Label(frame000, text=" ")
        self.lbl00a.pack( padx=5, pady=5)
        
        
        
        
    def getDate(self):
        x1 = self.entry1.get()
        nx = ""
        
        
        self.entry1.delete(0, 'end')
        
        self.lbl000.config(text="Names Are:")
        

        
        
        #read csv, and split on "," the line
        csv_file = csv.reader(open('test.csv', "rb"), delimiter=",")
        #loop through csv list
        for row in csv_file:
            if row[2] >= x1:
                nx+=str(row[0]+", ")
                with open("output5.csv", "ab") as fp:
                    wr = csv.writer(fp, dialect='excel')
                    wr.writerow(row)
                fp.close()
        self.lbl00a.config(text=nx)
        
    def openDate(self):
        os.system("start "+'output5.csv')
开发者ID:nakulrathore,项目名称:CSV_Play,代码行数:95,代码来源:SearchCSV.py

示例7: initUI

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
    def initUI(self):
        self.parent.title("Filter Data")
        self.pack(fill=BOTH, expand=True)
        labelfont20 = ('Roboto', 15, 'bold')
        labelfont10 = ('Roboto', 10, 'bold')
        labelfont8 = ('Roboto', 8, 'bold')
        
        frame0 = Frame(self)
        frame0.pack()
        
        lbl0 = Label(frame0, text="Hi Nakul")
        lbl0.config(font=labelfont20)    
        lbl0.pack( padx=5, pady=5)
        lbl00 = Label(frame0, text="Filter Data")
        lbl00.config(font=labelfont10)
        lbl00.pack( padx=5, pady=5)
        
        ####################################
        
        
        ##########################################
        
        
        ############################################
        #####printing line
        
        lbl5a = Label(text="__________________________________")
        lbl5a.pack()
        lbl5a.place(x=170, y=300)
        
        lbl5b = Label(text="__________________________________")
        lbl5b.pack()
        lbl5b.place(x=480, y=300)
        
        self.lbl5c = Label(text="Search Result Will Appear Here")
        self.lbl5c.pack()
        self.lbl5c.place(x=170, y=320)
        
        self.lbl5d = Label(text="File Name Will Appear Here")
        self.lbl5d.pack()
        self.lbl5d.place(x=480, y=320)
        
        ############################################
        
        
        #############################################
        
        ###############################################
        
        
        ##############################################
        
        #############################################
        
        frame11 = Frame(self)
        frame11.pack()
        frame11.place(x=200, y=100)
        
        lbl11x = Label(frame11,text="Class 10th %")
        lbl11x.pack(padx=0, pady=0)
        
               

        self.entry11 = Entry(width=12)
        self.entry11.pack(padx=1, expand=True)
        self.entry11.place(x=200, y=120) 
        
        
        
        
        ####################################################
        frame12 = Frame(self)
        frame12.pack()
        frame12.place(x=380, y=100)
        
        lbl12x = Label(frame12,text="Class 12th %")
        lbl12x.pack(padx=0, pady=0)
        
               

        self.entry12 = Entry(width=12)
        self.entry12.pack(padx=1, expand=True)
        self.entry12.place(x=380, y=120) 
        
        

        #####################################################
        frame13 = Frame(self)
        frame13.pack()
        frame13.place(x=550, y=100)
        
        lbl13x = Label(frame13,text="B.Tech %")
        lbl13x.pack(padx=0, pady=0)
        
               

        self.entry13 = Entry(width=12)
        self.entry13.pack(padx=1, expand=True)
        self.entry13.place(x=550, y=120) 
        
#.........这里部分代码省略.........
开发者ID:nakulrathore,项目名称:OpenPyXL_Play,代码行数:103,代码来源:SearchXL.py

示例8: Example

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
class Example(Frame):
  
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent
        
        self.initUI()
        
        
    def initUI(self):
        self.parent.title("Filter Data")
        self.pack(fill=BOTH, expand=True)
        labelfont20 = ('Roboto', 15, 'bold')
        labelfont10 = ('Roboto', 10, 'bold')
        labelfont8 = ('Roboto', 8, 'bold')
        
        frame0 = Frame(self)
        frame0.pack()
        
        lbl0 = Label(frame0, text="Hi Nakul")
        lbl0.config(font=labelfont20)    
        lbl0.pack( padx=5, pady=5)
        lbl00 = Label(frame0, text="Filter Data")
        lbl00.config(font=labelfont10)
        lbl00.pack( padx=5, pady=5)
        
        ####################################
        
        
        ##########################################
        
        
        ############################################
        #####printing line
        
        lbl5a = Label(text="__________________________________")
        lbl5a.pack()
        lbl5a.place(x=170, y=300)
        
        lbl5b = Label(text="__________________________________")
        lbl5b.pack()
        lbl5b.place(x=480, y=300)
        
        self.lbl5c = Label(text="Search Result Will Appear Here")
        self.lbl5c.pack()
        self.lbl5c.place(x=170, y=320)
        
        self.lbl5d = Label(text="File Name Will Appear Here")
        self.lbl5d.pack()
        self.lbl5d.place(x=480, y=320)
        
        ############################################
        
        
        #############################################
        
        ###############################################
        
        
        ##############################################
        
        #############################################
        
        frame11 = Frame(self)
        frame11.pack()
        frame11.place(x=200, y=100)
        
        lbl11x = Label(frame11,text="Class 10th %")
        lbl11x.pack(padx=0, pady=0)
        
               

        self.entry11 = Entry(width=12)
        self.entry11.pack(padx=1, expand=True)
        self.entry11.place(x=200, y=120) 
        
        
        
        
        ####################################################
        frame12 = Frame(self)
        frame12.pack()
        frame12.place(x=380, y=100)
        
        lbl12x = Label(frame12,text="Class 12th %")
        lbl12x.pack(padx=0, pady=0)
        
               

        self.entry12 = Entry(width=12)
        self.entry12.pack(padx=1, expand=True)
        self.entry12.place(x=380, y=120) 
        
        

        #####################################################
        frame13 = Frame(self)
        frame13.pack()
        frame13.place(x=550, y=100)
#.........这里部分代码省略.........
开发者ID:nakulrathore,项目名称:OpenPyXL_Play,代码行数:103,代码来源:SearchXL.py

示例9: setCard

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
    def setCard(self,cardnum,row,col):
        dodel = False
        if cardnum == -1:
            dodel = True
            cardnum = 1
        card = Card(cardnum)
        f = Frame(self, height = card.height, width = card.width)
        if (row == 2 and self.client.player == 'p1') or (row == 3 and self.client.player == 'p2'):
            f.config(height = card.height+20)
        if self.client.player == 'p1':
            f.grid(row=row+1, column=col)
        else:
            f.grid(row=6-row, column=NUM_COLS-col)
        f.pack_propagate(0)

        self.fgrid[row][col] = f
        
        pic = Label(f)
        if row <= 2:
            card.flip()
        if self.client.player == 'p2':
            card.flip()
        pic.config(image=card.img)
        pic.image = card.img
        pic.row = row
        pic.col = col
        pic.card = card
        
        def clicked(pic,ins,card):
            if ins.state == 'taking' and not pic.isNone:
                if pic.card.number == ins.activeCard:
                    endTime = time.time()
                    ins.delta = round(endTime-self.startTime,2)
                    print(ins.delta)
                    print("Got in "+str(ins.delta))
                    ins.client.sendMessage('took,'+str(ins.delta)+','+str(ins.faultCount))
                    if not ins.multiplayer:
                        ins.client.oppSendMessage('p2,took,20,0')
                    ins.changeState('waiting')

                    pic.pack_forget()
                    ins.model[pic.row][pic.col].isNone = True
                elif ins.activeCardRow == -1 or not (pic.row <= 2) == (ins.activeCardRow <= 2):
                    ins.faults[int(pic.row <= 2)] = 1
                    ins.faultCount = sum(ins.faults)
            elif ins.state == 'move-select-start':
                ins.movingPic = (pic.row, pic.col)
                print('moving card:')
                print(ins.movingPic)
                if (((self.client.player == 'p1' and pic.row > 2) or (self.client.player == 'p2' and pic.row <= 2))\
                    and not pic.isNone) or not ins.multiplayer:
                    ins.infoLabel.config(text="Card chosen. Select destination.")
                    ins.changeState('move-select-stop')

                else:
                    ins.infoLabel.config(text="Can't move that. Select a different card to move.")
                ins.moveButton.config(text="Cancel")

            elif ins.state == 'move-select-stop':
                print('to:')
                print((pic.row, pic.col))
                if ((self.client.player == 'p1' and pic.row <= 2) or (self.client.player == 'p2' and pic.row > 2))\
                    and not pic.isNone:
                    ins.infoLabel.config(text="Illegal move. Select a different card to move.")
                else:
                    ins.swapCards(self.movingPic,(pic.row, pic.col))
                    ins.infoLabel.config(text="Move completed. Select next card.")

                ins.changeState('move-select-start')




        
        f.bind("<Button-1>",lambda e,pic=pic,self=self,card=card:clicked(pic,self,card))
        pic.bind("<Button-1>",lambda e,pic=pic,self=self,card=card:clicked(pic,self,card))
        pic.pack(fill=BOTH)
        self.model[row][col] = pic

        if dodel:
            pic.pack_forget()
            self.model[row][col].isNone = True

        else:
            self.model[row][col].isNone = False
开发者ID:neubieser,项目名称:KarutaSimulator,代码行数:87,代码来源:KarutaSimulator.py

示例10: Page

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]
class Page(Frame):
	def __init__(self, parent, index=0):
		Frame.__init__(self, parent, height=530, relief=RAISED, borderwidth=1)
		self.parent = parent
		if index == 0:
			self.loadScriptPage()
		elif index == 1:
			self.scriptProcessPage()
		elif index == 2:
			self.sonifyProcessPage()
		elif index == 3:
			self.finishedPage()
		else:
			print "No Page here!"

		
	def loadScriptPage(self):
		
		# Button States
		self.parent.prevButton.config(state='disabled')
		if self.parent.scriptname != '':
			self.parent.nextButton.config(state='normal')

		explain = Label(self, text=txt.selectscript, justify=CENTER, font=root.fontH1)
		explain.pack(pady=50)

		self.loadedscript = Label(self, text=self.parent.scriptname, justify=CENTER, font=root.fontH1)
		self.loadedscript.pack()

		loadscriptBtn = Button(self, text="Load Script", command=self.getScript)
		loadscriptBtn.pack(pady=10)

	def scriptProcessPage(self):
		self.parent.prevButton.config(state='normal')
		self.parent.nextButton.config(state='normal')

		explain = Label(self, text="Character Selection", justify=CENTER, font=root.fontH1)
		explain.grid(row=0, columnspan=3, pady=20)

		# Instance Script
		self.parent.Script = ScreenPlay(normpath(self.parent.scriptpath))

		actorNames = self.parent.Script.topcharacters
		self.actorActive = []
		self.actorGender = []

		for i in range(6):
			Label(self, text=actorNames[i], width=20).grid(row=i+1, padx=10, pady=8)
			participateFrame = Frame(self ,relief=RAISED, borderwidth=1)
			participateFrame.grid(row=i+1,column=1, padx=10, ipady=2, ipadx=5)
			
			participate = BooleanVar()
			self.actorActive.append(participate)
			self.actorActive[i].set(True)

			Radiobutton(participateFrame, text="ON", variable=self.actorActive[i], value=True, command=self.updateVars).pack(side=LEFT)
			Radiobutton(participateFrame, text="OFF",  variable=self.actorActive[i], value=False, command=self.updateVars).pack(side=LEFT)

			genderFrame = Frame(self, relief=RAISED, borderwidth=1)
			genderFrame.grid(row=i+1,column=2, padx=30, ipady=2)
			
			gender = StringVar()
			self.actorGender.append(gender)
			self.actorGender[i].set('F')

			Label(genderFrame, text="Gender:").pack(side=LEFT, padx=10)

			Radiobutton(genderFrame, text="Female", variable=self.actorGender[i], value='F', command=self.updateVars).pack(side=LEFT, padx=5)
			Radiobutton(genderFrame, text="Male",  variable=self.actorGender[i], value='M', command=self.updateVars).pack(side=LEFT, padx=5)

		Label(self, text="______________________", justify=CENTER, state='disabled').grid(row=8, columnspan=3, pady=10)
		Label(self, text="Sonification Settings", justify=CENTER, font=root.fontH1).grid(row=9, columnspan=3, pady=10)

		sonificationFrame = Frame(self)
		sonificationFrame.grid(row=10, columnspan=3)

		Label(sonificationFrame, text="Tone Length", width=22).grid(row=0, column=0)
		self.tonelen = Combobox(sonificationFrame, state='readonly', values=['1/1','1/2','1/4', '1/8'])
		self.tonelen.bind("<<ComboboxSelected>>", self.updateCombobox)
		self.tonelen.current(1)
		self.tonelen.grid(row=0, column=1, padx=10, pady=5)

		Label(sonificationFrame, text="Sonification BPM", width=22).grid(row=1, column=0)
		self.bpm = Combobox(sonificationFrame, state='readonly', values=[100, 120, 140, 160, 180, 200, 220, 240, 260])
		self.bpm.bind("<<ComboboxSelected>>", self.updateCombobox)
		self.bpm.current(4)
		self.bpm.grid(row=1, column=1, padx=10, pady=5)

		Label(sonificationFrame, text="Dialogue Length per Tone", justify=LEFT).grid(row=2, column=0)
		self.dpt = Combobox(sonificationFrame, state='readonly', values=[1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000])
		self.dpt.bind("<<ComboboxSelected>>", self.updateCombobox)
		self.dpt.current(4)
		self.dpt.grid(row=2, column=1, padx=10, pady=5)

		self.submitSettings()

	def submitSettings(self):
		actorSelections = []
		sonifySettings = []

#.........这里部分代码省略.........
开发者ID:MaroGM,项目名称:gendersonification,代码行数:103,代码来源:main.py

示例11: Metadator

# 需要导入模块: from ttk import Label [as 别名]
# 或者: from ttk.Label import config [as 别名]

#.........这里部分代码省略.........
                              variable=self.def_xml)
        self.caz_cat = Checkbutton(self.tab_options,
                                   text=self.blabla.get('tab2_merge'),
                                   variable=self.def_cat)
        caz_odt = Checkbutton(self.tab_options,
                              text=u'Open Document Text (.odt)',
                              variable=self.def_odt)
        # widgets placement
        caz_doc.grid(row=1,
                     column=0,
                     sticky=N + S + W + E,
                     padx=2, pady=2)
        self.caz_cat.grid(row=2,
                          column=0,
                          sticky=N + S + W + E,
                          padx=2, pady=2)
        caz_xls.grid(row=1,
                     column=1,
                     sticky=N + S + W + E,
                     padx=2, pady=2)
        caz_xml.grid(row=2,
                     column=1,
                     sticky=N + S + W + E,
                     padx=2, pady=2)
        caz_odt.grid(row=3,
                     column=1,
                     sticky=N + S + W + E,
                     padx=2, pady=2)
        # disabling the widgets which work only on Windows OS
        if opersys != 'win32':
            self.logger.info('Disabling Windows reserved functions.')
            self.def_doc.set(0)
            self.def_cat.set(0)
            caz_doc.configure(state='disabled')
            self.caz_cat.configure(state='disabled')
        else:
            pass
        # make the catalog option depending on the Word option
        self.catalog_dependance()

        # tooltips
        InfoBulle(caz_doc,
                  message=self.dico_help.get(33)[1],
                  image=self.dico_help.get(33)[2])
        InfoBulle(caz_xls,
                  message=self.dico_help.get(34)[1],
                  image=self.dico_help.get(34)[2])
        InfoBulle(caz_xml,
                  message=self.dico_help.get(35)[1],
                  image=self.dico_help.get(35)[2])
        InfoBulle(caz_odt,
                  message=self.dico_help.get(36)[1],
                  image=self.dico_help.get(36)[2])
        InfoBulle(self.caz_cat,
                  message=self.dico_help.get(37)[1],
                  image=self.dico_help.get(37)[2])

                ### Tab 3: recurring attributes
        # Attribute selector
        self.lab_chps = Label(self.tab_attribs, text=self.blabla.get('tab3_sele'))
        self.ddl_attr = Combobox(self.tab_attribs, values=self.dico_rekur.keys())
        self.ddl_attr.bind("<<ComboboxSelected>>", self.edit_rekur)
        self.supr = Button(self.tab_attribs, text=self.blabla.get('tab3_supp'),
                           command=self.del_rekur)
        # frame
        self.FrRekur = Labelframe(self.tab_attribs,
开发者ID:Guts,项目名称:Metadator,代码行数:70,代码来源:Metadator.py


注:本文中的ttk.Label.config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。