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


Python screenmanager.ScreenManager方法代码示例

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


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

示例1: build

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def build(self):
            Window.size = (1024, 768)
            self.sm = ScreenManager()
            self.sm.add_widget(StartScreen(name='start'))
            self.sm.add_widget(GcodeViewerScreen(name='gcode'))
            self.sm.add_widget(ExitScreen(name='main'))
            self.sm.current = 'gcode'

            level = LOG_LEVELS.get('debug') if len(sys.argv) > 2 else LOG_LEVELS.get('info')
            Logger.setLevel(level=level)
            # logging.getLogger().setLevel(logging.DEBUG)
            return self.sm 
开发者ID:wolfmanjm,项目名称:kivy-smoothie-host,代码行数:14,代码来源:viewer.py

示例2: build

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def build(self):
            # Window.size = (800, 480)
            self.sc = SpindleCamera(name='spindle camera')
            self.scr = StartScreen(name='main')
            self.sm = ScreenManager()
            self.sm.add_widget(self.scr)
            self.sm.add_widget(self.sc)
            if not self.test:
                self.sm.current = 'spindle camera'

            return self.sm 
开发者ID:wolfmanjm,项目名称:kivy-smoothie-host,代码行数:13,代码来源:spindle_camera.py

示例3: init

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def init(self):
        self.username = ''
        self.password = ''
        self.crypt_file_path = ''
        self.screenmanager = ScreenManager(transition=SwapTransition())
        self.loginscreen = LoginScreen(name='screen-login')
        self.loginscreen.bind(on_login=self.login)
        self.ideascreen = IdeaScreen(name='screen-idea')
        self.ideascreen.bind(on_quit_app=self.quit)
        self.screenmanager.add_widget(self.loginscreen)
        self.screenmanager.add_widget(self.ideascreen)
        self.screenmanager.current = 'screen-login' 
开发者ID:anselm94,项目名称:segreto-3,代码行数:14,代码来源:app.py

示例4: build

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def build(self):
		screen = ScreenManager(transition=SwapTransition())
		screen.add_widget(FirstScreen())
		screen.add_widget(SecondScreen())
		screen.add_widget(ThirdScreen())
		return screen 
开发者ID:the-duck,项目名称:launcher,代码行数:8,代码来源:main.py

示例5: __init__

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def __init__(self, **kwargs):
        super(FileChooser, self).__init__(**kwargs)

        self.manager = ScreenManager()
        super(FileChooser, self).add_widget(self.manager)

        self.trigger_update_view = Clock.create_trigger(self.update_view)

        self.bind(view_mode=self.trigger_update_view) 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:11,代码来源:filechooser.py

示例6: test_card_screen_empty

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def test_card_screen_empty():
    """
    Ensure a relatively empty card results in the expected Screen object and
    the passed in ScreenManager instance and data_store is set for the card.
    """
    mock_screen_manager = mock.MagicMock()
    data_store = {"foo": "bar"}
    card = Card("title")
    result = card.screen(mock_screen_manager, data_store)
    assert card.screen_manager == mock_screen_manager
    assert card.data_store == data_store
    assert isinstance(result, Screen) 
开发者ID:ntoll,项目名称:pypercard,代码行数:14,代码来源:test_core.py

示例7: test_cardapp_init_no_data_store

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def test_cardapp_init_no_data_store():
    """
    Ensure the CardApp instance is set up with the expected defaults.
    """
    app = CardApp()
    assert app.data_store == {}
    assert app.cards == {}
    assert isinstance(app.screen_manager, ScreenManager)
    assert app.title == "A PyperCard Application :-)" 
开发者ID:ntoll,项目名称:pypercard,代码行数:11,代码来源:test_core.py

示例8: test_cardapp_init_title_datastore_and_stack

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def test_cardapp_init_title_datastore_and_stack():
    """
    Ensure the CardApp instance is set up with the expected user defined
    values.
    """
    stack = [Card("test")]
    app = CardApp("An App", {"foo": "bar"}, stack)
    assert app.data_store == {"foo": "bar"}
    assert app.cards == {"test": stack[0]}
    assert isinstance(app.screen_manager, ScreenManager)
    assert app.title == "An App" 
开发者ID:ntoll,项目名称:pypercard,代码行数:13,代码来源:test_core.py

示例9: test_cardapp_build

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def test_cardapp_build():
    """
    Ensure the screen_manager instance is returned to display as the
    application.
    """
    app = CardApp()
    assert isinstance(app.build(), ScreenManager) 
开发者ID:ntoll,项目名称:pypercard,代码行数:9,代码来源:test_core.py

示例10: screen

# 需要导入模块: from kivy.uix import screenmanager [as 别名]
# 或者: from kivy.uix.screenmanager import ScreenManager [as 别名]
def screen(self, screen_manager, data_store):
        """
        Return a screen instance containing all the necessary UI items that
        have been associated with the expected event handlers.

        :param kivy.uix.screenmanager.ScreenManager screen_manager: The UI
            stack of screens which controls which card is to be displayed.
        :param dict data_store: A dictionary containing application state.
        :return: A graphical representation of the card.
        """
        # References to app related objects.
        self.screen_manager = screen_manager
        self.data_store = data_store
        # The Kivy Screen instance used to draw the UI.
        screen = Screen(name=self.title)
        # Bind event handlers to life-cycle events.
        screen.bind(on_enter=self._enter)
        screen.bind(on_pre_enter=self._pre_enter)
        screen.bind(on_pre_leave=self._leave)
        # The main layout that defines how UI elements are drawn.
        self.layout = BoxLayout(orientation="vertical")
        screen.add_widget(self.layout)
        # The sound player for this card.
        self.player = None
        # Text font size for the Screen instance.
        self.font_size = "{}sp".format(self.text_size)
        if self.form:
            self._draw_form()
        elif self.text:
            self._draw_text()
        else:
            # For padding purposes.
            self.layout.add_widget(Label(text=" "))
        if self.sound:
            self.player = SoundLoader.load(self.sound)
            self.player.loop = self.sound_repeat
        if self.background:
            self.layout.bind(size=self._update_rect, pos=self._update_rect)
            with self.layout.canvas.before:
                if isinstance(self.background, tuple):
                    Color(*self.background)
                    self.rect = Rectangle(
                        size=self.layout.size, pos=self.layout.pos
                    )
                else:
                    self.rect = Rectangle(
                        source=self.background,
                        size=self.layout.size,
                        pos=self.layout.pos,
                    )
        if self.buttons:
            self._draw_buttons()
        return screen 
开发者ID:ntoll,项目名称:pypercard,代码行数:55,代码来源:core.py


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