diff options
author | Nat <Nat@localhost.localdomain> | 2007-02-20 22:08:18 (GMT) |
---|---|---|
committer | Nat <Nat@localhost.localdomain> | 2007-02-20 22:08:18 (GMT) |
commit | 48cb3b6b69ea3d1bf106f7194dfb06823de1070f (patch) | |
tree | 9ddd8824864565b4388dfbbe59b9e275f6a575a2 /Util/InstrumentPanel.py | |
parent | 92bc2d9c240cb791c740b8454e92f87b2662c05f (diff) |
Tentative Instrument panels in Edit
Diffstat (limited to 'Util/InstrumentPanel.py')
-rw-r--r-- | Util/InstrumentPanel.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Util/InstrumentPanel.py b/Util/InstrumentPanel.py index f94fa46..da0e842 100644 --- a/Util/InstrumentPanel.py +++ b/Util/InstrumentPanel.py @@ -9,7 +9,7 @@ from Util.ThemeWidgets import * Tooltips = Config.Tooltips class InstrumentPanel(gtk.EventBox): - def __init__(self,setInstrument = None, playInstrument = None, enterMode = False, micRec = None, synthRec = None, rowLen = 8): + def __init__(self,setInstrument = None, playInstrument = None, enterMode = False, micRec = None, synthRec = None, rowLen = 8, _instDic = None ): gtk.EventBox.__init__(self) color = gtk.gdk.color_parse(Config.PANEL_BCK_COLOR) self.modify_bg(gtk.STATE_NORMAL, color) @@ -28,7 +28,10 @@ class InstrumentPanel(gtk.EventBox): self.mainVBox = gtk.VBox() self.draw_toolbar() - self.generateInstDic() + if _instDic == None: + self.instDic = self.getInstDic() + else: + self.instDic = _instDic self.draw_instruments_panel() self.add(self.mainVBox) @@ -122,7 +125,8 @@ class InstrumentPanel(gtk.EventBox): self.recstate = True btn.set_active(True) - def generateInstDic(self): + def getInstDic(self): + instDic = {} self.firstInstButton = None for instrument in self.getInstrumentList('all'): if instrument[0:3] == 'lab' or instrument[0:3] == 'mic': @@ -145,8 +149,7 @@ class InstrumentPanel(gtk.EventBox): RecBtn.connect('pressed', self.handleRecButtonPress, Btn) vbox.pack_start(RecBtn,False,False,1) vbox.pack_start(Btn,False,False,2) - self.instDic[instrument] = vbox - + instDic[instrument] = vbox else: instBox = RoundVBox(fillcolor = Config.INST_BCK_COLOR, bordercolor = Config.PANEL_COLOR, radius = Config.PANEL_RADIUS) instBox.set_border_width(Config.PANEL_SPACING) @@ -155,9 +158,10 @@ class InstrumentPanel(gtk.EventBox): if self.enterMode: instButton.connect('enter',self.handleInstrumentButtonEnter, instrument) instBox.pack_start(instButton,False,False) - self.instDic[instrument] = instBox + instDic[instrument] = instBox if self.firstInstButton == None: self.firstInstButton = instButton + return instDic def getInstrumentList(self,category = 'all'): |