Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Util
diff options
context:
space:
mode:
authoramartin <olpc@localhost.localdomain>2007-02-19 03:42:47 (GMT)
committer amartin <olpc@localhost.localdomain>2007-02-19 03:42:47 (GMT)
commit75472134803d2353d02cc6bb06e278a535f142d6 (patch)
tree75c6b332e7e7de2adfef2d0199d5c28f7318084a /Util
parent5c0a1f13238cee741c163ed1d76ea71d85b0d0e6 (diff)
instrumentPanel in edit mode, first draft
Diffstat (limited to 'Util')
-rw-r--r--Util/InstrumentPanel.py (renamed from Util/InstrumentsPanel.py)14
1 files changed, 7 insertions, 7 deletions
diff --git a/Util/InstrumentsPanel.py b/Util/InstrumentPanel.py
index afd708b..0c40f50 100644
--- a/Util/InstrumentsPanel.py
+++ b/Util/InstrumentPanel.py
@@ -8,7 +8,7 @@ import Config
from Util.ThemeWidgets import *
Tooltips = Config.Tooltips
-class InstrumentsPanel(gtk.EventBox):
+class InstrumentPanel(gtk.EventBox):
def __init__(self,setInstrument = None, playInstrument = None, enterMode = False):
gtk.EventBox.__init__(self)
@@ -51,7 +51,7 @@ class InstrumentsPanel(gtk.EventBox):
instrumentNum = len(self.getInstrumentList(category))
instruments = self.getInstrumentList(category)
- cols = 8
+ cols = 9
if instrumentNum < cols:
cols = instrumentNum
rows = (instrumentNum // cols)
@@ -72,13 +72,13 @@ class InstrumentsPanel(gtk.EventBox):
def handleInstrumentButtonClick(self,widget,instrument):
if widget.get_active() is True:
- self.setInstrument(instrument)
- self.playInstrument(instrument)
+ if self.setInstrument: self.setInstrument(instrument)
+ if self.playInstrument: self.playInstrument(instrument)
if self.enterMode:
pass #Close the window
def handleInstrumentButtonEnter(self,widget,instrument):
- self.playInstrument(instrument)
+ if self.playInstrument: self.playInstrument(instrument)
def draw_mic_lab_box(self):
hbox = gtk.HBox()
@@ -152,8 +152,8 @@ class InstrumentsPanel(gtk.EventBox):
if __name__ == "__main__":
win = gtk.Window()
- wc = InstrumentsPanel()
+ wc = InstrumentPanel()
win.add(wc)
win.show()
#start the gtk event loop
- gtk.main() \ No newline at end of file
+ gtk.main()