本文整理匯總了Python中kivy.lang方法的典型用法代碼示例。如果您正苦於以下問題:Python kivy.lang方法的具體用法?Python kivy.lang怎麽用?Python kivy.lang使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kivy
的用法示例。
在下文中一共展示了kivy.lang方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_inspector
# 需要導入模塊: import kivy [as 別名]
# 或者: from kivy import lang [as 別名]
def create_inspector(win, ctx, *l):
'''Create an Inspector instance attached to the *ctx* and bound to the
Windows :meth:`~kivy.core.window.WindowBase.on_keyboard` event for capturing
the keyboard shortcut.
:Parameters:
`win`: A :class:`Window <kivy.core.window.WindowBase>`
The application Window to bind to.
`ctx`: A :class:`~kivy.uix.widget.Widget` or subclass
The Widget to be inspected.
'''
# Dunno why, but if we are creating inspector within the start(), no lang
# rules are applied.
ctx.inspector = Inspector(win=win)
win.bind(children=ctx.inspector.on_window_children,
on_keyboard=ctx.inspector.keyboard_shortcut)