def show_splash(show=True): """ Show a splash screen @param show: [bool] show the splash screen """ if not show: return splash_window = gtk.Window(gtk.WINDOW_POPUP) splash_window.set_size_request(391, 143) splash_window.set_position(gtk.WIN_POS_CENTER) splash_window.set_resizable(False) splash_window.set_transient_for(None) splash_window.set_destroy_with_parent(True) splash_window.set_skip_taskbar_hint(True) splash_window.set_skip_pager_hint(True) splash_window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN) splash_window.set_decorated(False) splash_image = gtk.Image() splash_image.set_visible(True) splash_image.set_from_pixbuf(app_theme.get_pixbuf("splash/%s_splash.png" % get_prefix()).get_pixbuf()) splash_window.add(splash_image) # Show the splash screen without causing startup notification. gtk.window_set_auto_startup_notification(False) splash_window.show_all() gtk.window_set_auto_startup_notification(True) # ensure that the splash gets completely drawn before we move on while gtk.events_pending(): gtk.main_iteration() return splash_window
def close(self): gtk.window_set_auto_startup_notification(True) while (max(1.5 - (time() - self.start_time), 0) != 0): sleep(0.1) if gtk.events_pending(): gtk.main_iteration() self.window.destroy()
def show_splash(show=True): """ Show a splash screen @param show: [bool] show the splash screen """ if not show: return splash_window = gtk.Window(gtk.WINDOW_POPUP) splash_window.set_size_request(391, 143) splash_window.set_position(gtk.WIN_POS_CENTER) splash_window.set_resizable(False) splash_window.set_transient_for(None) splash_window.set_destroy_with_parent(True) splash_window.set_skip_taskbar_hint(True) splash_window.set_skip_pager_hint(True) splash_window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN) splash_window.set_decorated(False) splash_image = gtk.Image() splash_image.set_visible(True) splash_image.set_from_pixbuf( app_theme.get_pixbuf("splash/%s_splash.png" % get_prefix()).get_pixbuf()) splash_window.add(splash_image) # Show the splash screen without causing startup notification. gtk.window_set_auto_startup_notification(False) splash_window.show_all() gtk.window_set_auto_startup_notification(True) #ensure that the splash gets completely drawn before we move on while gtk.events_pending(): gtk.main_iteration() return splash_window
def show(self): """ Shows the splash screen """ # Show the splash screen without causing startup notification. gtk.window_set_auto_startup_notification(False) self.window.show_all() gtk.window_set_auto_startup_notification(True) # Ensure the splash is completely drawn before moving on while gtk.events_pending(): gtk.main_iteration()
def show(self): """ Shows the splash screen """ # Show the splash screen without causing startup notification. gtk.window_set_auto_startup_notification(False) self.window.show_all() gtk.window_set_auto_startup_notification(True) # Ensure the splash is completely drawn before moving on while gtk.events_pending(): gtk.main_iteration()
def _splash(): _splash_win = win = gtk.Window() win.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN) win.set_title('Cimarrón splash') win.set_size_request(200, 100) win.set_position(gtk.WIN_POS_CENTER_ALWAYS) lbl = gtk.Label() lbl.set_text('Loading...') lbl.set_alignment(1, 1) gtk.window_set_auto_startup_notification(False) win.add(lbl) win.show_all() while gtk.events_pending(): gtk.main_iteration() gtk.window_set_auto_startup_notification(True) _splash_win.hide()
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()
def show_splash(show=True): """ Show a splash screen @param show: [bool] show the splash screen """ if not show: return builder = gtk.Builder() builder.add_from_file(xdg.get_data_path("ui/splash.ui")) image = builder.get_object('splash_image') image.set_from_file(xdg.get_data_path("images/splash.png")) splash_screen = builder.get_object('SplashScreen') splash_screen.set_transient_for(None) # Show the splash screen without causing startup notification. gtk.window_set_auto_startup_notification(False) splash_screen.show_all() gtk.window_set_auto_startup_notification(True) #ensure that the splash gets completely drawn before we move on while gtk.events_pending(): gtk.main_iteration() return splash_screen
def create_application(splash): w = Main() gtk.window_set_auto_startup_notification(True)
splashVBox.pack_start(gtk.Label("A GTK+ toy user interface"), True, True, 0) eb.add(splashVBox) splash.add(eb) splash.realize() splash.window.set_type_hint (gtk.gdk.WINDOW_TYPE_HINT_SPLASHSCREEN) # needed on Win32 splash.set_decorated (False) splash.set_position (gtk.WIN_POS_CENTER) return splash def create_application(splash): w = Main() gtk.window_set_auto_startup_notification(True) gtk.window_set_auto_startup_notification(False) splash = get_splash() splash.show_all() gobject.idle_add(create_application, splash) def gobject_process_revents(): robjects.rinterface.process_revents() return True gobject.timeout_add(300, gobject_process_revents) gtk.main()