class ConnectTheDotsActivity(activity.Activity): def __init__(self, handle): activity.Activity.__init__(self, handle) self.make_toolbar() hbox = Gtk.HBox() self.set_canvas(hbox) self.area = Area() hbox.pack_start(self.area, True, False, 0) self.show_all() def make_toolbar(self): toolbarbox = ToolbarBox() self.set_toolbar_box(toolbarbox) button = ActivityToolbarButton(self) toolbarbox.toolbar.insert(button, -1) toolbarbox.toolbar.insert(Gtk.SeparatorToolItem(), -1) button_new = ToolButton("new-button") button_new.set_tooltip(_("New")) button_new.connect("clicked", self._next_level) toolbarbox.toolbar.insert(button_new, -1) separator = Gtk.SeparatorToolItem() separator.props.draw = False separator.set_expand(True) toolbarbox.toolbar.insert(separator, -1) button = StopButton(self) toolbarbox.toolbar.insert(button, -1) def _next_level(self, button): self.area.next_level()