diff options
-rw-r--r-- | Edit/MainWindow.py | 1 | ||||
-rw-r--r-- | Util/InstrumentPanel.py | 11 |
2 files changed, 8 insertions, 4 deletions
diff --git a/Edit/MainWindow.py b/Edit/MainWindow.py index 22b5bf6..dc29b11 100644 --- a/Edit/MainWindow.py +++ b/Edit/MainWindow.py @@ -680,6 +680,7 @@ class MainWindow( SubActivity ): def pickInstrument( self, widget, num ): self.panel_track = num + self.instrumentPanel.selectFirstCat() self.instrumentPanel.set_activeInstrument( self._data['track_inst'][num], True ) self.GUI["2main"].remove( self.GUI["2rightPanel"] ) self.GUI["2main"].pack_start( self.instrumentPanel ) diff --git a/Util/InstrumentPanel.py b/Util/InstrumentPanel.py index da56ca4..84c8f11 100644 --- a/Util/InstrumentPanel.py +++ b/Util/InstrumentPanel.py @@ -39,18 +39,21 @@ class InstrumentPanel(gtk.EventBox): def draw_toolbar(self): toolbarBox = gtk.HBox() - firstBtn = None + self.firstTbBtn = None for category in Config.CATEGORIES: btnBox = RoundVBox(fillcolor = '#6F947B', bordercolor = Config.PANEL_BCK_COLOR, radius = Config.PANEL_RADIUS) btnBox.set_border_width(Config.PANEL_SPACING) - btn = ImageRadioButton(firstBtn,Config.IMAGE_ROOT + category + '.png', Config.IMAGE_ROOT + category + 'sel.png', Config.IMAGE_ROOT + category + 'sel.png') - if firstBtn == None: - firstBtn = btn + btn = ImageRadioButton(self.firstTbBtn,Config.IMAGE_ROOT + category + '.png', Config.IMAGE_ROOT + category + 'sel.png', Config.IMAGE_ROOT + category + 'sel.png') + if self.firstTbBtn == None: + self.firstTbBtn = btn btn.connect('clicked',self.handleToolbarBtnPress,category) btnBox.add(btn) toolbarBox.pack_start(btnBox,True,True) self.mainVBox.pack_start(toolbarBox,False,False) + + def selectFirstCat(self): + self.firstTbBtn.set_active(True) def handleToolbarBtnPress(self, widget, category): self.draw_instruments_panel(category) |