当前位置: 首页>>代码示例>>Python>>正文


Python app.App方法代码示例

本文整理汇总了Python中kivy.app.App方法的典型用法代码示例。如果您正苦于以下问题:Python app.App方法的具体用法?Python app.App怎么用?Python app.App使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.app的用法示例。


在下文中一共展示了app.App方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_touch_up

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def on_touch_up( self, touch ):
		global minUITimer

		if touch.grab_current is self:
			touch.ungrab( self )
			with thermostatLock:
				if minUITimer != None:
					Clock.unschedule( show_minimal_ui )
				minUITimer = Clock.schedule_once( show_minimal_ui, minUITimeout )
				self.manager.current = "thermostatUI"
				log( LOG_LEVEL_DEBUG, CHILD_DEVICE_SCREEN, MSG_SUBTYPE_TEXT, "Full" )
			return True


##############################################################################
#                                                                            #
#       Kivy Thermostat App class                                            #
#                                                                            #
############################################################################## 
开发者ID:chaeron,项目名称:thermostat,代码行数:21,代码来源:thermostat.py

示例2: build

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def build(self): 

		# adding GridLayouts in App 
		# Defining number of coloumn 
		# You can use row as well depends on need 
		layout = GridLayout(cols = 2) 

		# 1st row 
		layout.add_widget(Button(text ='Hello 1')) 
		layout.add_widget(Button(text ='World 1')) 

		# 2nd row 
		layout.add_widget(Button(text ='Hello 2')) 
		layout.add_widget(Button(text ='World 2')) 

		# 3rd row 
		layout.add_widget(Button(text ='Hello 3')) 
		layout.add_widget(Button(text ='World 3')) 

		# 4th row 
		layout.add_widget(Button(text ='Hello 4')) 
		layout.add_widget(Button(text ='World 4')) 

		# returning the layout 
		return layout 

# creating object of the App class 
开发者ID:rpotter12,项目名称:spotify-downloader-music-player,代码行数:29,代码来源:kivy.py

示例3: on_start

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def on_start(self):
        # bind to the keyboard to listen to
        # specific key codes
        from utils.keyboard import hook_keyboard
        hook_keyboard()
        # let's load our first screen
        load_screen('StartupScreen')

# Check if app is started as main and only then insitantiate the App class. 
开发者ID:pythonindia,项目名称:PyCon-Mobile-App,代码行数:11,代码来源:main.py

示例4: add_kivy_panel

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def add_kivy_panel(self):
        '''Add a panel for configuring Kivy. This panel acts directly on the
        kivy configuration. Feel free to include or exclude it in your
        configuration.

        See :meth:`~kivy.app.App.use_kivy_settings` for information on
        enabling/disabling the automatic kivy panel.

        '''
        from kivy import kivy_data_dir
        from kivy.config import Config
        from os.path import join
        self.add_json_panel('Kivy', Config,
                            join(kivy_data_dir, 'settings_kivy.json')) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:16,代码来源:settings.py

示例5: __init__

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def __init__(self, app=None, *args, **kwargs):
        if app is None:
            app = App()
        EventLoop.safe = Event()
        self.safe = EventLoop.safe
        self.safe.set()
        EventLoop.confirmed = Event()
        self.confirmed = EventLoop.confirmed
        self.app = app

        def startApp(app=app, *args, **kwargs):
            app.run(*args, **kwargs)

        self.thread = Thread(target=startApp, *args, **kwargs) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:16,代码来源:interactive.py

示例6: main

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def main():
	# Start Web Server
	webThread = threading.Thread( target=startWebServer )
	webThread.daemon = True
	webThread.start()

	# Start Scheduler
	reloadSchedule()
	schedThread = threading.Thread( target=startScheduler )
	schedThread.daemon = True
	schedThread.start()

	# Start Thermostat UI/App
	ThermostatApp().run() 
开发者ID:chaeron,项目名称:thermostat,代码行数:16,代码来源:thermostat.py

示例7: load_screen

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def load_screen(self, screen, manager=None, store_back=True):
        '''Load the provided screen:
        arguments::
            `screen`: is the name of the screen to be loaded
            `manager`: the manager to load this screen, this defaults to
            the main class.
        '''
        store_back = False if screen == 'StartupScreen' else store_back

        manager = manager or self.root
        # load screen modules dynamically
        # for example load_screen('LoginScreen')
        # will look for uix/screens/loginscreen
        # load LoginScreen 
        module_path = screen.lower()
        if not hasattr(self, module_path):
            import imp
            module = imp.load_module(screen, *imp.find_module(module_path))
            screen_class = getattr(module, screen)
            sc = screen_class() 
            sc.from_back = not store_back
            setattr(self, module_path, sc)
            manager.add_widget(sc)

        else:
            sc = getattr(self, module_path)

        sc.from_back = not store_back
        manager.current = screen

        if store_back:
            self._navigation_higherarchy.append(sc)

        return getattr(self, module_path)

# Check if app is started as main and only then insitantiate the App class. 
开发者ID:pydelhi,项目名称:pydelhi_mobile,代码行数:38,代码来源:main.py

示例8: build

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def build(self):
        EventLoop.ensure_window()
        EventLoop.window.title = self.title = 'Rockivy | Kivy App Contest 2014'

        if EventLoop.window.__class__.__name__.endswith('Pygame'):
            try:
                # because pygame hates nice cursors
                pygame_set_cursor()
            except:
                pass

        game = Game()
        self.on_start = game.on_start
        return init_ui(game) 
开发者ID:mvasilkov,项目名称:kivy-2014,代码行数:16,代码来源:main.py

示例9: exit_game

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def exit_game(self):
        exit(0)

    # App share with Android
    # It will open an intent to share a message 
开发者ID:aron-bordin,项目名称:Kivy-Tutorials,代码行数:7,代码来源:main.py

示例10: image

# 需要导入模块: from kivy import app [as 别名]
# 或者: from kivy.app import App [as 别名]
def image(self, filename, load_callback=None, post_callback=None,
              **kwargs):
        '''Load a image using the Loader. A ProxyImage is returned with a
        loading image. You can use it as follows::

            from kivy.app import App
            from kivy.uix.image import Image
            from kivy.loader import Loader

            class TestApp(App):
                def _image_loaded(self, proxyImage):
                    if proxyImage.image.texture:
                        self.image.texture = proxyImage.image.texture

                def build(self):
                    proxyImage = Loader.image("myPic.jpg")
                    proxyImage.bind(on_load=self._image_loaded)
                    self.image = Image()
                    return self.image

            TestApp().run()

        In order to cancel all background loading, call *Loader.stop()*.
        '''
        data = Cache.get('kv.loader', filename)
        if data not in (None, False):
            # found image, if data is not here, need to reload.
            return ProxyImage(data,
                              loading_image=self.loading_image,
                              loaded=True, **kwargs)

        client = ProxyImage(self.loading_image,
                            loading_image=self.loading_image, **kwargs)
        self._client.append((filename, client))

        if data is None:
            # if data is None, this is really the first time
            self._q_load.appendleft({
                'filename': filename,
                'load_callback': load_callback,
                'post_callback': post_callback,
                'kwargs': kwargs})
            if not kwargs.get('nocache', False):
                Cache.append('kv.loader', filename, False)
            self._start_wanted = True
            self._trigger_update()
        else:
            # already queued for loading
            pass

        return client

#
# Loader implementation
# 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:57,代码来源:loader.py


注:本文中的kivy.app.App方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。