def create_ui(self, accelgroup, menu, toolbars, fullscreen, embed): "create_ui(menu, toolbars, fullscreen, embed)" # add horizontal elements hbox = gtk.HBox() if toolbars["left"]: hbox.pack_start(toolbars["left"], False, True) if embed: self._add_uisocket(hbox) if toolbars["right"]: hbox.pack_start(toolbars["right"], False, True) # add vertical elements vbox = gtk.VBox() if menu: vbox.add(menu) if toolbars["top"]: vbox.pack_start(toolbars["top"], False, True) vbox.add(hbox) if toolbars["bottom"]: vbox.pack_start(toolbars["bottom"], False, True) # put them to main window mainwin = gtk.Window(gtk.WINDOW_TOPLEVEL) mainwin.set_title("%s %s" % (UInfo.name, UInfo.version)) mainwin.set_icon_from_file(UInfo.icon) if accelgroup: mainwin.add_accel_group(accelgroup) if fullscreen: mainwin.fullscreen() mainwin.add(vbox) mainwin.show_all() # for run and quit callbacks self.killdialog = KillDialog(mainwin) mainwin.connect("delete_event", self.quit) self.mainwin = mainwin
def quit(self, widget, arg): KillDialog(self.window).run(self.hatari) gtk.main_quit()