16 class NotationApplication:
18 self.music = music.Music_document ()
20 nc = notation.Notation_controller (self.music)
21 self.notation_controller = nc
23 ncc = notationcanvas.Notation_canvas_controller (nc.notation)
24 self.notation_canvas_controller = ncc
26 self.window = self.create_window ()
28 def create_window (self):
30 win.connect ('destroy', mainquit)
31 win.set_title ('Ikebana - visual music notation')
33 canvas = self.notation_canvas_controller.canvas
36 tb_type = notationcanvas.Notation_toolbar
37 toolbar = tb_type (self.notation_canvas_controller.notation,
38 self.notation_canvas_controller.check_update
41 canvas.connect ("key-press-event", toolbar.keypress_callback)
44 vbox.pack_start (canvas, expand=True)
45 vbox.pack_start (toolbar, expand=False)
51 toolbar.add_button ('zoom out', 'minus', lambda: canvas.zoom (-1), 0)
52 toolbar.add_button ('zoom in', 'Shift+plus', lambda: canvas.zoom (1), 0)
59 self.notation_controller.update_notation ()
60 self.notation_canvas_controller.update_canvas ()
62 if __name__ == '__main__':
63 c = NotationApplication ()