當前位置: 首頁>>代碼示例>>Python>>正文


Python CheckBox.height方法代碼示例

本文整理匯總了Python中kivy.uix.checkbox.CheckBox.height方法的典型用法代碼示例。如果您正苦於以下問題:Python CheckBox.height方法的具體用法?Python CheckBox.height怎麽用?Python CheckBox.height使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kivy.uix.checkbox.CheckBox的用法示例。


在下文中一共展示了CheckBox.height方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from kivy.uix.checkbox import CheckBox [as 別名]
# 或者: from kivy.uix.checkbox.CheckBox import height [as 別名]
 def __init__(self, title, choices, key, callback):
     Factory.Popup.__init__(self)
     if type(choices) is list:
         choices = dict(map(lambda x: (x,x), choices))
     layout = self.ids.choices
     layout.bind(minimum_height=layout.setter('height'))
     for k, v in sorted(choices.items()):
         l = Label(text=v)
         l.height = '48dp'
         l.size_hint_x = 4
         cb = CheckBox(group='choices')
         cb.value = k
         cb.height = '48dp'
         cb.size_hint_x = 1
         def f(cb, x):
             if x: self.value = cb.value
         cb.bind(active=f)
         if k == key:
             cb.active = True
         layout.add_widget(l)
         layout.add_widget(cb)
     layout.add_widget(Widget(size_hint_y=1))
     self.callback = callback
     self.title = title
     self.value = key
開發者ID:btchip,項目名稱:electrum,代碼行數:27,代碼來源:choice_dialog.py

示例2: __init__

# 需要導入模塊: from kivy.uix.checkbox import CheckBox [as 別名]
# 或者: from kivy.uix.checkbox.CheckBox import height [as 別名]
 def __init__(self, title, choices, key, callback, keep_choice_order=False):
     Factory.Popup.__init__(self)
     print(choices, type(choices))
     if keep_choice_order:
         orig_index = {choice: i for (i, choice) in enumerate(choices)}
         sort_key = lambda x: orig_index[x[0]]
     else:
         sort_key = lambda x: x
     if type(choices) is list:
         choices = dict(map(lambda x: (x,x), choices))
     layout = self.ids.choices
     layout.bind(minimum_height=layout.setter('height'))
     for k, v in sorted(choices.items(), key=sort_key):
         l = Label(text=v)
         l.height = '48dp'
         l.size_hint_x = 4
         cb = CheckBox(group='choices')
         cb.value = k
         cb.height = '48dp'
         cb.size_hint_x = 1
         def f(cb, x):
             if x: self.value = cb.value
         cb.bind(active=f)
         if k == key:
             cb.active = True
         layout.add_widget(l)
         layout.add_widget(cb)
     layout.add_widget(Widget(size_hint_y=1))
     self.callback = callback
     self.title = title
     self.value = key
開發者ID:ahmedbodi,項目名稱:electrum,代碼行數:33,代碼來源:choice_dialog.py

示例3: __init__

# 需要導入模塊: from kivy.uix.checkbox import CheckBox [as 別名]
# 或者: from kivy.uix.checkbox.CheckBox import height [as 別名]
 def __init__(self, title, choices, key, callback):
     Factory.Popup.__init__(self)
     for k, v in choices.items():
         l = Label(text=v)
         l.height = '48dp'
         cb = CheckBox(group='choices')
         cb.value = k
         cb.height = '48dp'
         def f(cb, x):
             if x: self.value = cb.value
         cb.bind(active=f)
         if k == key:
             cb.active = True
         self.ids.choices.add_widget(l)
         self.ids.choices.add_widget(cb)
     self.ids.choices.add_widget(Widget(size_hint_y=1))
     self.callback = callback
     self.title = title
     self.value = key
開發者ID:Emzy,項目名稱:electrum,代碼行數:21,代碼來源:choice_dialog.py


注:本文中的kivy.uix.checkbox.CheckBox.height方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。