久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <bdo id='9e34a'></bdo><ul id='9e34a'></ul>

  • <i id='9e34a'><tr id='9e34a'><dt id='9e34a'><q id='9e34a'><span id='9e34a'><b id='9e34a'><form id='9e34a'><ins id='9e34a'></ins><ul id='9e34a'></ul><sub id='9e34a'></sub></form><legend id='9e34a'></legend><bdo id='9e34a'><pre id='9e34a'><center id='9e34a'></center></pre></bdo></b><th id='9e34a'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='9e34a'><tfoot id='9e34a'></tfoot><dl id='9e34a'><fieldset id='9e34a'></fieldset></dl></div>

        <legend id='9e34a'><style id='9e34a'><dir id='9e34a'><q id='9e34a'></q></dir></style></legend>

        <tfoot id='9e34a'></tfoot>
      1. <small id='9e34a'></small><noframes id='9e34a'>

        Kivy:如何將復選框設置為在啟動時選中

        Kivy: how to set checkbox to checked on start up(Kivy:如何將復選框設置為在啟動時選中)

        <small id='ZpkZS'></small><noframes id='ZpkZS'>

          <bdo id='ZpkZS'></bdo><ul id='ZpkZS'></ul>

              1. <i id='ZpkZS'><tr id='ZpkZS'><dt id='ZpkZS'><q id='ZpkZS'><span id='ZpkZS'><b id='ZpkZS'><form id='ZpkZS'><ins id='ZpkZS'></ins><ul id='ZpkZS'></ul><sub id='ZpkZS'></sub></form><legend id='ZpkZS'></legend><bdo id='ZpkZS'><pre id='ZpkZS'><center id='ZpkZS'></center></pre></bdo></b><th id='ZpkZS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZpkZS'><tfoot id='ZpkZS'></tfoot><dl id='ZpkZS'><fieldset id='ZpkZS'></fieldset></dl></div>
                <legend id='ZpkZS'><style id='ZpkZS'><dir id='ZpkZS'><q id='ZpkZS'></q></dir></style></legend>

                    <tbody id='ZpkZS'></tbody>
                  <tfoot id='ZpkZS'></tfoot>
                  本文介紹了Kivy:如何將復選框設置為在啟動時選中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  How can I set the status of the checkbox with the id set to blue to be checked on start up. I use python 3.6 and Kivy 1.9.2.dev0. I thought the lines blue = ObjectProperty(True) in .py and value: root.blue in .kv would do that but apparently I am misunderstanding how ObjectProperty works

                  import kivy
                  from kivy.app import App
                  from kivy.uix.boxlayout import BoxLayout
                  from kivy.properties import ObjectProperty
                  from kivy.core.window import Window
                  
                  class SampBoxLayout(BoxLayout):
                  
                      # For radio buttons
                      blue = ObjectProperty(True)
                      red = ObjectProperty(False)
                  
                  class SimpleApp(App):
                      def build(self):
                          Window.clearcolor = (1, 1, 1, 1)
                          return SampBoxLayout()
                  
                  sample_app = SimpleApp()
                  sample_app.run()
                  

                  The .kv:

                  #: import CheckBox kivy.uix.checkbox
                  
                  
                  <SampBoxLayout>
                      orientation: "vertical"
                      padding: 10
                      spacing: 10
                      BoxLayout:
                          orientation: "horizontal"
                          size_hint_x: .55
                          Label:
                              text: "Favorite Color:"
                              color: 0, 0, 0, 1
                              size_hint_x: .265
                          Label:
                              text: "Blue"
                              color: 0, 0, 0, 1
                              size_hint_x: .15
                          CheckBox:
                              group: "fav_color"
                              id : blue
                              value: root.blue
                              size_hint_x: .05
                          Label:
                              text: "Red"
                              color: 0, 0, 0, 1
                              size_hint_x: .15
                          CheckBox:
                              group: "fav_color"
                              value: root.red
                              size_hint_x: .05
                  

                  Edit: why use value and not active?

                  def on_checkbox_active(checkbox, value):
                      if value:
                          print('The checkbox', checkbox, 'is active')
                      else:
                          print('The checkbox', checkbox, 'is inactive')
                  

                  解決方案

                  No you did not misunderstand it. You just used the wrong attribute name.
                  Set the active attribute instead of value:

                  from kivy.app import App
                  from kivy.uix.boxlayout import BoxLayout
                  from kivy.properties import ObjectProperty
                  from kivy.lang import Builder
                  
                  
                  root = Builder.load_string('''
                  
                  <MyWidget>:
                      CheckBox:
                          id: blue
                          active: root.blue
                      CheckBox:
                          id: red
                          active: root.red
                  ''')
                  
                  class MyWidget(BoxLayout):
                      blue = ObjectProperty(True)
                      red = ObjectProperty(False)
                  
                  class MyApp(App):
                  
                      def build(self):
                          return MyWidget()
                  
                  MyApp().run()
                  

                  這篇關于Kivy:如何將復選框設置為在啟動時選中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                    <bdo id='AFhdx'></bdo><ul id='AFhdx'></ul>
                  • <tfoot id='AFhdx'></tfoot>

                          <tbody id='AFhdx'></tbody>

                        <small id='AFhdx'></small><noframes id='AFhdx'>

                          <i id='AFhdx'><tr id='AFhdx'><dt id='AFhdx'><q id='AFhdx'><span id='AFhdx'><b id='AFhdx'><form id='AFhdx'><ins id='AFhdx'></ins><ul id='AFhdx'></ul><sub id='AFhdx'></sub></form><legend id='AFhdx'></legend><bdo id='AFhdx'><pre id='AFhdx'><center id='AFhdx'></center></pre></bdo></b><th id='AFhdx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='AFhdx'><tfoot id='AFhdx'></tfoot><dl id='AFhdx'><fieldset id='AFhdx'></fieldset></dl></div>
                            <legend id='AFhdx'><style id='AFhdx'><dir id='AFhdx'><q id='AFhdx'></q></dir></style></legend>

                          1. 主站蜘蛛池模板: jlzzjlzz国产精品久久 | 久久久久国产一区二区三区四区 | 亚洲91视频| 久久久久国产一区二区三区 | 黑人精品 | 日韩精品在线网站 | 国产片侵犯亲女视频播放 | 成人免费网站在线 | 中国三级黄色录像 | 亚洲欧美中文日韩在线v日本 | 天天看天天操 | 99福利视频导航 | 欧美日韩国产欧美 | 精品国产一区二区国模嫣然 | 久久99国产精品久久99果冻传媒 | 亚洲成人三区 | 羞羞视频在线观看 | 国产一区二 | 日韩一区二区三区在线播放 | 在线观看亚洲精品视频 | 在线观看中文字幕 | www日本在线 | 成人在线观 | 亚洲精品二三区 | 日韩免费视频一区二区 | 欧美成人一区二区 | 日日夜夜天天久久 | 九九热精品在线视频 | 国产在线精品一区 | 国产一区二区三区四区 | 五月天婷婷激情 | 99热精品6| 午夜码电影 | 国产精品不卡一区二区三区 | 你懂的在线视频播放 | 亚洲第一色av | 国产99小视频 | 午夜合集| 欧美在线日韩 | 国产区在线观看 | dy天堂|