Example #1
0
 def _setupCategories(self, config):
     """Add buttons to browse between categories
     
     config -- ConfigParser containing application settings
     
     """
     #Get all button data
     lines = []
     ctr = 1
     option = ini.image + str(ctr)
     
     while(config.has_option(ini.year, option)):
         line = config.get(ini.year, option)
         lines.append(line)
         ctr += 1
         option = ini.image + str(ctr)
         
     #Create as many buttons as needed
     buttondata = zip(lines, self._years)
     
     if(len(buttondata) < len(self._years)):
         print('Warning! There are more categories than category buttons - some categories will not be shown')
         
     ctr = 0
     
     for (line, year) in buttondata:
         tb = TransparentButton(self._canvas, self._settings.generalfont, line, self._scalefactor)
         tb.setText(year)
         tb.setCommand(self._ehYear)
         tb.index = ctr
         ctr += 1
         self._activeInPreview.append(tb)
Example #2
0
    def _setupControls(self, root, config):
        """Initiate control buttons        
        
        root -- the Tk instance of the application
        config -- ConfigParser containing application settings

        """
        iniline = config.get(ini.controls, ini.prev)
        tb = TransparentButton(self._canvas, self._settings.generalfont, iniline, self._scalefactor)
        tb.setCommand(self._ehPrev)
        self._btnPrev = tb
        self._activeInPreview.append(tb)
        
        iniline = config.get(ini.controls, ini.next)
        tb = TransparentButton(self._canvas, self._settings.generalfont, iniline, self._scalefactor)
        tb.setCommand(self._ehNext)
        self._btnNext = tb
        self._activeInPreview.append(tb)

        iniline = config.get(ini.controls, ini.start)
        tb = TransparentButton(self._canvas, self._settings.generalfont, iniline, self._scalefactor)
        self._btnPlay = tb