def do_activate(self): if not self.get_app_menu(): builder = Gtk.Builder() builder.add_from_resource("/org/gnome/News/Menu.ui") menu = builder.get_object("app-menu") self.set_app_menu(menu) for action_name in ["about", "quit"]: action = Gio.SimpleAction.new(action_name, None) action.connect("activate", getattr(self, action_name)) self.add_action(action) if not self._window: self._window = Window(self) self._window.present()
def do_activate(self): if not self._window: self._window = Window(self) self._window.present()