def __init__(self, *args, **kwargs): super(AppView, self).__init__(*args, **kwargs) # Setup about window: def on_aboutbox_response(dialog, response, *args): if response < 0: dialog.hide() dialog.emit_stop_by_name('response') def on_aboutbox_close(widget, event=None): self["about_window"].hide() return gtk.TRUE self["about_window"].set_version(settings.VERSION) pixbuf = gtk.gdk.pixbuf_new_from_file(resource_filename(__name__, "icons/pyxrd.png")) # @UndefinedVariable scaled_buf = pixbuf.scale_simple(212, 160, gtk.gdk.INTERP_BILINEAR) # @UndefinedVariable self["about_window"].set_logo(scaled_buf) self["about_window"].connect("response", on_aboutbox_response) self["about_window"].connect("close", on_aboutbox_close) self["about_window"].connect("delete_event", on_aboutbox_close) self["main_window"].set_icon_list(*get_icon_list()) # self.set_layout_modes() self.reset_all_views() if not settings.DEBUG: self.get_top_widget().maximize() self._clear_gdk_windows() self.get_top_widget().show() return
def __init__(self, *args, **kwargs): super(AppView, self).__init__(*args, **kwargs) # Setup about window: def on_aboutbox_response(dialog, response, *args): if response < 0: dialog.hide() dialog.emit_stop_by_name('response') def on_aboutbox_close(widget, event=None): self["about_window"].hide() return True self["about_window"].set_version(settings.VERSION) pixbuf = GdkPixbuf.Pixbuf.new_from_file(resource_filename(__name__, "icons/pyxrd.png")) # @UndefinedVariable scaled_buf = pixbuf.scale_simple(212, 160, GdkPixbuf.InterpType.BILINEAR) # @UndefinedVariable self["about_window"].set_logo(scaled_buf) self["about_window"].connect("response", on_aboutbox_response) self["about_window"].connect("close", on_aboutbox_close) self["about_window"].connect("delete_event", on_aboutbox_close) self["main_window"].set_icon_list(get_icon_list()) self.reset_all_views() if not settings.DEBUG: self.get_top_widget().maximize() self.set_layout_mode(settings.DEFAULT_LAYOUT) self._clear_gdk_windows() self.get_top_widget().show() return
def __init__(self, filename, version=""): # DONT connect 'destroy' event here! self.window = Gtk.Window(Gtk.WindowType.TOPLEVEL) self.window.set_auto_startup_notification(False) self.window.set_default_icon_list(get_icon_list()) self.window.set_icon_list(get_icon_list()) self.window.set_title('PyXRD') self.window.set_skip_taskbar_hint(True) self.window.set_position(Gtk.WindowPosition.CENTER) self.window.set_decorated(False) self.window.set_resizable(False) self.window.set_border_width(1) self.window.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse('white')) # @UndefinedVariable ebox = Gtk.EventBox( ) # prevent the black color from showing through... self.window.add(ebox) main_vbox = Gtk.VBox(False, 1) main_vbox.set_border_width(10) ebox.add(main_vbox) self.img = ScalableImage() self.img.set_from_file(filename) self.img.set_size_request(500, 300) main_vbox.pack_start(self.img, True, True, 0) self.lbl = Gtk.Label() self.lbl.set_markup("<span size=\"larger\"><b>Loading ...</b></span>") self.lbl.set_alignment(0.5, 0.5) main_vbox.pack_end(self.lbl, True, True, 0) self.version_lbl = Gtk.Label() self.version_lbl.set_markup("<i>Version %s</i>" % version) self.version_lbl.set_alignment(0.5, 0.5) main_vbox.pack_end(self.version_lbl, True, True, 0) self.window.show_all() while Gtk.events_pending(): Gtk.main_iteration() self.start_time = time() self.closed = False
def __init__(self, *args, **kwargs): super(AppView, self).__init__(*args, **kwargs) # Setup about window: def on_aboutbox_response(dialog, response, *args): if response < 0: dialog.hide() dialog.emit_stop_by_name('response') def on_aboutbox_close(widget, event=None): self["about_window"].hide() return True self["about_window"].set_version(settings.VERSION) self["about_window"].set_website( "https://github.com/PyXRD/PyXRD/blob/v%s/Manual.pdf" % settings.VERSION) pixbuf = GdkPixbuf.Pixbuf.new_from_file( resource_filename(__name__, "icons/pyxrd.png")) # @UndefinedVariable scaled_buf = pixbuf.scale_simple( 212, 160, GdkPixbuf.InterpType.BILINEAR) # @UndefinedVariable self["about_window"].set_logo(scaled_buf) self["about_window"].connect("response", on_aboutbox_response) self["about_window"].connect("close", on_aboutbox_close) self["about_window"].connect("delete_event", on_aboutbox_close) self["main_window"].set_icon_list(get_icon_list()) self.reset_all_views() if not settings.DEBUG: self.get_top_widget().maximize() self.set_layout_mode(settings.DEFAULT_LAYOUT) self._clear_gdk_windows() self.get_top_widget().show() return
def __init__(self, filename, version=""): # DONT connect 'destroy' event here! gtk.window_set_auto_startup_notification(False) self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_icon_list(*get_icon_list()) self.window.set_title('PyXRD') self.window.set_position(gtk.WIN_POS_CENTER) self.window.set_decorated(False) self.window.set_resizable(False) self.window.set_border_width(1) self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black')) # @UndefinedVariable ebox = gtk.EventBox() # prevent the black color from showing through... self.window.add(ebox) main_vbox = gtk.VBox(False, 1) main_vbox.set_border_width(10) ebox.add(main_vbox) self.img = ScalableImage() self.img.set_from_file(filename) self.img.set_size_request(500, 300) main_vbox.pack_start(self.img, True, True) self.lbl = gtk.Label() self.lbl.set_markup("<span size=\"larger\"><b>Loading ...</b></span>") self.lbl.set_alignment(0.5, 0.5) main_vbox.pack_end(self.lbl, True, True) self.version_lbl = gtk.Label() self.version_lbl.set_markup("<i>Version %s</i>" % version) self.version_lbl.set_alignment(0.5, 0.5) main_vbox.pack_end(self.version_lbl, True, True) self.window.show_all() while gtk.events_pending(): gtk.main_iteration() self.start_time = time()