Beispiel #1
0
    def setUpWidgets(self):
        #Top widgets
        #self.headerFrame = Frame(self.root, width=WIDTH)
        #self.headerFrame.grid(row=0,column=0,columnspan=2)
        #headerImage = Image.open(self.appDirectory + '\\images\\header.png')
        #headerPhoto = ImageTk.PhotoImage(headerImage)
        #self.headerLabel = Label(self.headerFrame,image=headerPhoto,width=WIDTH,height=65,bg='orange')
        #self.headerLabel.image = headerPhoto
        #self.headerLabel.pack()
        #End top widgets

        #Sound widgets
        Pmw.initialise(self.root)
        #Pmw.Color.setscheme(self.root,background='#EEEEEE')

        #self.soundsFrame = Frame(self.root, width=SOUNDFRAMEWIDTH,height=SOUNDFRAMEHEIGHT,background='#EEEEEE')
        #self.soundsFrame.grid(row=1,column=0)

        #End of sound widgets

        #Formant Plot widgets
        self.mainFrame = Frame(self.root,
                               width=FORMANTPLOTFRAMEWIDTH,
                               height=FORMANTPLOTFRAMEHEIGHT,
                               background='#EEEEEE')
        self.mainFrame.grid(row=1, column=1)

        self.tabbedPane = Pmw.NoteBook(self.mainFrame)

        self.tabbedPane.pack(fill='both')
        #self.formantTab = self.tabbedPane.add('Formant Plot')
        self.formantTab = self.tabbedPane.add('Senior Male')
        self.formantTab1 = self.tabbedPane.add('Young Male')
        self.formantTab2 = self.tabbedPane.add('Senior Female')
        self.formantTab3 = self.tabbedPane.add('Young Female')

        self.formantPlot = FormantPlot(self.formantTab, self.appDirectory,
                                       self.root, True, 0)
        self.formantPlot1 = FormantPlot(self.formantTab1, self.appDirectory,
                                        self.root, True, 1)
        self.formantPlot2 = FormantPlot(self.formantTab2, self.appDirectory,
                                        self.root, False, 2)
        self.formantPlot3 = FormantPlot(self.formantTab3, self.appDirectory,
                                        self.root, False, 3)

        self.menubar = Menu(self.root)
        self.filemenu1 = Menu(self.menubar)
        self.filemenu2 = Menu(self.menubar)
        self.filemenu3 = Menu(self.menubar, tearoff=0)

        self.menubar.add_cascade(label="File",
                                 font="Arial 13",
                                 menu=self.filemenu1)
        self.filemenu1.add_command(label="Save",
                                   font=('Arial', '13'),
                                   command=(lambda: self.save()))
        self.filemenu1.add_command(label="Load Audio File",
                                   font=('Arial', '13'),
                                   command=(lambda: self.load()))
        self.filemenu1.add_command(label="Play Last Recorded Sound",
                                   font=('Arial', '13'),
                                   state='disabled')
        self.filemenu1.add_command(label="Play Loaded File",
                                   font=('Arial', '13'),
                                   state='disabled')
        self.menubar.add_cascade(label="Show",
                                 font=('Arial', '13'),
                                 menu=self.filemenu2)
        self.filemenu2.add_command(label="Show Loaded Vowels",
                                   font=('Arial', '13'),
                                   command=(lambda: self.showVowel()))
        self.filemenu2.add_command(label="Hide Loaded Vowels",
                                   font=('Arial', '13'),
                                   command=(lambda: self.hideVowel()))

        self.root.config(menu=self.menubar)

        #self.pronunciationTab = self.tabbedPane.add('Pronunciation Aid')

        #End of Formant Plot widgets

        #Pronunciation Plot widgets

        #self.pronunciationAid = PronunciationAid(self.pronunciationTab,self.appDirectory,self.root)

        #End Pronunciation Plot widgets
        self.tabbedPane.setnaturalsize()