本文整理汇总了Python中kivy.uix.spinner.Spinner.text方法的典型用法代码示例。如果您正苦于以下问题:Python Spinner.text方法的具体用法?Python Spinner.text怎么用?Python Spinner.text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kivy.uix.spinner.Spinner
的用法示例。
在下文中一共展示了Spinner.text方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_row
# 需要导入模块: from kivy.uix.spinner import Spinner [as 别名]
# 或者: from kivy.uix.spinner.Spinner import text [as 别名]
def add_row(self, instance):
"""
Add a row to the main exchange screen
:param instance:
:return:
"""
self.num_rows += 1
keys_button = Button(text='Keys', size_hint_x=0.2, id='%d' % self.num_rows)
keys_button.bind(on_release=self.enter_keys)
self.content.add_widget(keys_button)
self.keys_button.append(keys_button)
address = TextInput(size_hint_x=0.2, padding=[6, 10, 6, 10],
multiline=False, font_size=18, id='%d' % self.num_rows)
address.bind(text=self.check_address)
self.content.add_widget(address)
self.address.append(address)
unit = Spinner(values=self.currencies, text=self.currencies[0], size_hint_x=0.2, id='%d' % self.num_rows)
self.selected_unit = self.currencies[0]
unit.bind(text=self.set_unit)
self.content.add_widget(unit)
self.unit.append(unit)
rates = Button(text='Rates', size_hint_x=0.2, id='%d' % self.num_rows)
rates.bind(on_release=self.enter_rates)
self.content.add_widget(rates)
self.rates.append(rates)
bot = Spinner(values=self.bots, text=self.bots[0], size_hint_x=0.2, id='%d' % self.num_rows)
self.selected_bot = self.bots[0]
bot.bind(text=self.set_bot)
self.content.add_widget(bot)
self.bot.append(bot)
if isinstance(instance, dict):
keys_button.text = instance['public'][:8] + ' / ' + instance['secret'][:8]
address.text = instance['address']
unit.text = instance['unit']
rates.text = instance['ask'] + ' | ' + instance['bid']
bot.text = instance['bot']
示例2: getUI
# 需要导入模块: from kivy.uix.spinner import Spinner [as 别名]
# 或者: from kivy.uix.spinner.Spinner import text [as 别名]
def getUI(self):
"""get the ui element"""
if 'enum' in self._typeInfo:
result = Spinner()
result.values = self._typeInfo['enum']
elif self._typeInfo['type'].lower() == 'boolean':
result = Spinner()
result.values = ['true', 'false']
else:
result = TextInput()
if self.value:
result.text = self.value.lower()
skin = sm.getSkin('text', self.asset)
result.size = sm.getControlSize(skin, self.asset)
self.uiEl = result
self.prepareUiElement()
result.bind(text=self.value_changed)
return result