diff options
author | Daniel Francis <francis@sugarlabs.org> | 2013-02-15 12:21:53 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2013-02-15 12:21:53 (GMT) |
commit | e600d59f3fecbce310f35d463e78835d7f302e67 (patch) | |
tree | fda202c321ea96fd75e38c8a26c2a127f6ae3830 | |
parent | 03ee5b634ca5b2ca3f624907afb9d388679eb3f0 (diff) |
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
-rw-r--r-- | main.py | 14 | ||||
m--------- | stafflib | 0 |
2 files changed, 13 insertions, 1 deletions
@@ -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() diff --git a/stafflib b/stafflib -Subproject b19af58e00a37aacdec8ad477e0ca99cc04793f +Subproject f00eba64e75dcfe3e770d609a2fadc42c27f4ee |