def SDL_fixed_window_show(): Window.show() if SDL_needfix: # doing this on >= 2.0.9 causes problems (lose Window focus) # not doing this on lesser versions ignores Window.show() altogether Window.maximize() Window.restore()
def build(self): self.themes = { 'dark': self.color_theme_dark, 'light': self.color_theme_light, 'rgb': self.color_theme_rgb, 'custom': None } self.transitions = { 'slide': SlideTransition, 'wipe': WipeTransition, 'fade': FadeTransition, 'fall out': FallOutTransition, 'none': NoTransition } if getattr(sys, 'frozen', False): from app.screens import mainmenu, wikipedia, notebook, translation, youtube, todo, books, settings, about else: from screens import mainmenu, wikipedia, notebook, translation, youtube, todo, books, settings, about self.user_settings = settings.SettingsBackend().show_settings() self.root = ScreenManager() self.mainmenu = mainmenu.MainMenu() self.wikipedia = wikipedia.Wikipedia() self.notebook = notebook.Notebook() self.translation = translation.Translation() self.youtube = youtube.Youtube() self.todo = todo.ToDo() self.books = books.Books() self.settings = settings.Settings() self.about = about.About() self.screens = { 'mainmenu': self.mainmenu, 'wikipedia': self.wikipedia, 'notebook': self.notebook, 'translation': self.translation, 'youtube': self.youtube, 'todo': self.todo, 'books': self.books, 'settings': self.settings, 'about': self.about } self.themes['custom'] = self.settings.color_theme_custom self.root.switch_to(self.mainmenu) try: self.root.transition = self.transitions.get( self.user_settings.get('page_transition'))() except BaseException: self.root.transition = SlideTransition() self.themes.get(self.user_settings.get('theme'))() Window.show() return self.root
def build(self): # Binding the drop file Window.bind(on_dropfile=self._on_file_drop) # Detects when mouse has entered window and focuses window as a result Window.bind(on_cursor_enter=lambda *__: Window.show()) # Setup manager class. self.manager = Manager(transition=SlideTransition()) return self.manager
def build(self): global widget_set, data_sources os.system("cd $SNAP") print("Initializing Bot") print("Collecting Data") data_sources["1"] = [ "Sure.", "Why Not.", "Yeah.", "OK.", "Just a second." ] data_sources["2"] = [ "Sorry, Cant Help You With That!", "I cannot Understand!", "Cant Do it.", "I am Not Sure I Understand!", "Try something else!" ] data_sources["run"] = [ "office--__sudo libreoffice", "notepad--__sudo gedit" ] data_sources["mean"] = data_source.get() print("Collected Data") print("Connecting to dbus interface") os.system("xdg-open start >/dev/null 2>&1") print("Connected to dbus interface") print("Initializing GUI") widget_set["float"] = FloatLayout() widget_set["log"] = TextInput() widget_set["entry"] = TextInput() widget_set["entry_line_1"] = TextInput() widget_set["entry_line_2"] = TextInput() widget_set["heading"] = Label() widget_set["logo"] = Image() ProBot.init_widgets() print("Initialized GUI") print("Verifying NLTK libraries") nltk.download('stopwords') nltk.download('punkt') print("Verified NLTK libraries") print("Starting") Window.show() return widget_set["float"]
def build(self, *args, **kwargs): self.draw_fps = True self.fps = Fps() self.time = 0. self.last_time = 0. self.time_mult = 1. self.time_mult_pause = None Clock.schedule_interval(self.update, 0) self.event_once = None self.root = Space() Config.read('config.ini') # For my window header # dx, dy = -1, -32 dx, dy = 0, 0 if Config.get('graphics', 'position') != 'auto': Window.left, Window.top, Window.size = Config.getint('graphics', 'left') + dx, \ Config.getint('graphics', 'top') + dy, \ (Config.getint('graphics', 'width'), \ Config.getint('graphics', 'height'),) if Config.getboolean('graphics', 'maximize'): Window.maximize() Window.show() self.root.bind(on_touch_down=self.on_touch_down, on_touch_move=self.on_touch_move, on_touch_up=self.on_touch_up) if self.filename: Clock.schedule_once( partial( import_module(self.filename).set_state, self.root, self), 1) return self.root
def main_thread_updates(self, dt): """ This method updates some graphic properties of the windows. I could set this changes using bindings but some windows properties can only be touched from the main Thread. All the sensitive updates to be done in the main Thread are collected within this method """ # Replaced with the window_util.move_window method because faster and less cpu consuming # Window moving logic # if self.WindowYPosVelocity != 0: # Window.top += self.WindowYPosVelocity # if self.WindowXPosVelocity != 0: # Window.left += self.WindowXPosVelocity # Window hiding/showing logic if self.is_in_pause != self.is_hide: if self.is_in_pause: Window.hide() else: Window.show() self.is_hide = not self.is_hide
def build(self): global widget_set print("Initializing Bot") print("Connecting to dbus interface") os.system("xdg-open restart >/dev/null 2>&1") print("Connected to dbus interface") print("Initializing GUI") widget_set["float"] = FloatLayout() widget_set["log"] = TextInput() widget_set["entry"] = TextInput() widget_set["entry_line_1"] = TextInput() widget_set["entry_line_2"] = TextInput() widget_set["heading"] = Label() widget_set["activity"] = TextInput() widget_set["logo"] = Image() ProBot.init_widgets() print("Initialized GUI") print("Verifying NLTK libraries") nltk.download('stopwords') nltk.download('punkt') print("Verified NLTK libraries") print("Starting") Window.show() return widget_set["float"]
def __init__(self, **kw): super().__init__(**kw) self.ids.search_input.bind( focus=lambda __, val: setattr(self, 'list_shown', val), text=self.ids.desktop_view.filter_items) self._window_state_conditions_check_clock = Clock.schedule_interval( self._check_window_state_conditions, WINDOW_HIDE_CHECK_INTERVAL) self._window_state_event = Clock.create_trigger( self._change_window_state_if_conditions, WINDOW_HIDE_MIN_TIME) Window.bind(on_dropfile=self.on_dropfile, focus=self.on_window_focus, on_cursor_enter=lambda *__: Window.show())
def on_restore(self, window): self.window_minimized = False Window.show()
def show(self): Window.hide() Window.show()
import SCREEN_TEMPERATURE import SCREEN_READ_AND_WRITE import SCREEN_CONTROL import SCREEN_BOOTLOADER_SETTINGS import SCREEN_SETTING ##===================================================================================== ## ##===================================================================================== sm = ScreenManager() sm.add_widget(TEMPERATURE(name = 'TEMPERATURE')) sm.add_widget(READ_AND_WRITE(name = 'READ_AND_WRITE')) sm.add_widget(CONTROL(name = 'CONTROL')) sm.add_widget(BOOTLOADER_SETTINGS(name = 'BOOTLOADER_SETTINGS')) sm.add_widget(SETTING(name = 'SETTING')) class MainApplication(App): def build(self): return sm if __name__ == '__main__': Window.size = (1024,768) Window.minimum_width = (800) Window.minimum_height = (600) Window.clearcolor = (.33,.34,.38,1) Window.show() MainApplication().run()
def show_window(self): """Bring minimized and/or hidden App window to the forefront.""" Window.show() Window.raise_window()
def show(dummy): Window.show()
def minimize_screenshot(self, *args): CoreWindow.hide() Clock.schedule_once(lambda *args: self.take_whole_screen_screenshot(), 0.1) Clock.schedule_once(lambda *args: CoreWindow.show(), 0.2)