def main(): """Main function.""" # Create an instance of QApplication pycalc = QApplication(sys.argv) # Show the calculator's GUI view = GUI() view.show() sys.exit(pycalc.exec_())
def controller(): """ This function start the tkinter interface and the home of the game""" global options_settings options_settings = Option("difficile", "lightblue", "non") Interface = GUI(width, height) Interface.option = options_settings launchMenu(Interface) Interface.launchGUI() # This active the tkinter thread
def main(): """Main function.""" # Create an instance of QApplication pycalc = QApplication(sys.argv) # Show the calculator's GUI view = GUI() view.show() model = evaluateExpression Controller(model=model, view=view) sys.exit(pycalc.exec_())
def main(): """Main function.""" # Create an instance of QApplication pycalc = QApplication(sys.argv) # Show the calculator's GUI view = GUI() view.show() # Create instances of the model and the controller Model = evaluateExpression Controller(model=Model, view=view) # Execute the calculator's main loop sys.exit(pycalc.exec_())
def __init__(self): # These 3 are need GObject.threads_init() DBusGMainLoop(set_as_default=True) Gst.init(None) self.sound_menu = SoundMenuControls('anoise') self.noise = Noise() self.win_preferences = Preferences(self) # Need in a few DE try: self.window = GUI(self) except: pass self.player = Gst.ElementFactory.make(PLAYBIN, "player") self.player.connect("about-to-finish", self._loop) self.player.set_property('uri', self.noise.get_current_filename()) self.is_playing = True dummy_i18n = (_("Coffee Shop"), _("Fire"), _("Forest"), _("Night"), _("Rain"), _("River"), _("Sea"), _("Storm"), _("Wind")) # Need i18n # Overwrite libraty methods self.sound_menu._sound_menu_is_playing = self._sound_menu_is_playing self.sound_menu._sound_menu_play = self._sound_menu_play self.sound_menu._sound_menu_pause = self._sound_menu_pause self.sound_menu._sound_menu_next = self._sound_menu_next self.sound_menu._sound_menu_previous = self._sound_menu_previous self.sound_menu._sound_menu_raise = self._sound_menu_raise # Autostart when click on sound indicator icon threading.Timer(2, self._sound_menu_play).start()
def __init__(self): # These 3 are needed GObject.threads_init() DBusGMainLoop(set_as_default=True) Gst.init(None) GLib.set_application_name(_('Ambient Noise')) self.sound_menu = SoundMenuControls('Ambient Noise', 'anoise') self.noise = Noise() self.win_preferences = Preferences(self) try: self.keybinder = Keybinder self.keybinder.init() if self.keybinder.bind('AudioPlay', self._sound_menu_play_toggle, None): self.keybinder.bind('AudioStop', self._sound_menu_stop, None) self.keybinder.bind('AudioPause', self._sound_menu_pause, None) self.keybinder.bind('AudioNext', self._sound_menu_next, None) self.keybinder.bind('AudioPrev', self._sound_menu_previous, None) else: self.keybinder = None except (ValueError, ImportError): self.keybinder = None # Need in a few DE try: self.window = GUI(self) except: pass self.player = Gst.ElementFactory.make(PLAYBIN, "player") self.player.connect("about-to-finish", self._loop) dummy_i18n = (_("Coffee Shop"), _("Fire"), _("Forest"), _("Night"), _("Rain"), _("River"), _("Sea"), _("Storm"), _("Wind") ) # Need i18n # Overwrite libraty methods self.sound_menu._sound_menu_is_playing = self._sound_menu_is_playing self.sound_menu._sound_menu_play = self._sound_menu_play self.sound_menu._sound_menu_pause = self._sound_menu_pause self.sound_menu._sound_menu_next = self._sound_menu_next self.sound_menu._sound_menu_previous = self._sound_menu_previous self.sound_menu._sound_menu_raise = self._sound_menu_raise self.sound_menu._sound_menu_play_toggle = self._sound_menu_play_toggle # Autostart when click on sound indicator icon threading.Timer(1, self._sound_menu_play).start()
def main(): """Runs the application.""" gui = GUI(tk.Tk()) c = Controller(gui) gui.window.mainloop()
from view import GUI GUI().render()