Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rw-r--r--main.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/main.py b/main.py
index 0a6752e..5162857 100644
--- a/main.py
+++ b/main.py
@@ -14,12 +14,24 @@ vbox = Gtk.Box()
vbox.set_orientation(Gtk.Orientation.VERTICAL)
staff = StaffArea()
vbox.pack_start(staff, True, True, 0)
-notes = ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C', 'D', 'F', 'G', 'A', 'B', 'C']
+notes = ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'A', 'B', 'C']
notesbox = Gtk.Box()
+
+def button_toggled_cb(widget, note):
+ active = widget.get_active()
+ if active:
+ staff.select_note(note)
+ else:
+ staff.unselect_note(note)
+
+count = 1
for i in notes:
button = Gtk.ToggleButton(i)
+ button.connect('toggled', button_toggled_cb, count)
button.show()
notesbox.pack_start(button, True, True, 0)
+ count += 1
+
notesbox.show()
vbox.pack_start(notesbox, False, True, 0)
vbox.show()