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

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

    <small id='9Q5XT'></small><noframes id='9Q5XT'>

          <bdo id='9Q5XT'></bdo><ul id='9Q5XT'></ul>
        <tfoot id='9Q5XT'></tfoot><legend id='9Q5XT'><style id='9Q5XT'><dir id='9Q5XT'><q id='9Q5XT'></q></dir></style></legend>

      1. Kivy:如何將畫布用于在 python 中創建的小部件

        Kivy: how to use canvas for widgets created in python(Kivy:如何將畫布用于在 python 中創建的小部件)
      2. <small id='w31Ie'></small><noframes id='w31Ie'>

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

              <bdo id='w31Ie'></bdo><ul id='w31Ie'></ul>
                <tbody id='w31Ie'></tbody>

                1. 本文介紹了Kivy:如何將畫布用于在 python 中創建的小部件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想在我的復選框中添加一個畫布來更改它們的顏色.我找到了這個答案,但我正在努力實現它.我的復選框是使用以下代碼在 python 中創建的:

                  I would like to add a canvas to my checkboxes to change their color. I have found this answer, but I am struggling to implement it. My checkboxes are created in python with this code:

                  checkb= CheckBox()
                  layout.add_widget(checkb)
                  

                  嘗試 1:我嘗試了 這里但沒有成功:

                  Attempt 1: I tried the solution from here but without success:

                  checkb= CheckBox()
                  checkb.canvas.add(Color(1., 1., 0))
                  checkb.canvas.add(Rectangle(size=(50, 50)))
                  layout.add_widget(checkb)
                  

                  嘗試 2:我還嘗試在構建器中創建一個自定義復選框,但沒有找到使其工作的方法(我找不到有關這種設置的任何信息,所以我不確定甚至可以讓它工作):

                  Attempt 2: I also tried to come up with a custom checkbox created in the builder but didn't find a way to make it work (I couldn't find any info about this kind of setup, so I am not sure it's even possible to make it work):

                  Builder.load_string('''
                  <CustomCk@CheckBox>:
                      canvas.before:
                          Color:
                              rgb: 1,0,0
                          Rectangle:
                              pos:self.center_x-8, self.center_y-8
                              size:[16,16]
                          Color:
                              rgb: 0,0,0
                          Rectangle:
                              pos:self.center_x-7, self.center_y-7
                              size:[14,14]                
                  
                  ''')
                  

                  checkb= CustomCk()
                  layout.add_widget(checkb)
                  

                  <小時>

                  我嘗試使用 with 語句:


                  Edit : my try with the with statement:

                  checkb= CheckBox()  
                  with checkb.canvas:
                      Color(1, 2, 0)
                      Rectangle(size=(50, 50))
                  layout.add_widget(checkb)
                  

                  推薦答案

                  你應該使用 Python 代碼中的 with 語句

                  You should use the with statement from your python code

                  with checkb.canvas:
                      Color(1., 1., 0)
                      Rectangle(size=(50, 50))
                  

                  您的其他方法似乎更好,只需稍微修復一下:

                  Your other approach seems better, just fix it a bit:

                  Builder.load_string('''
                  <CustomCk>:
                      canvas.before:
                          Color:
                              rgb: 1,0,0
                          Rectangle:
                              pos:self.center_x-8, self.center_y-8
                              size:[16,16]
                          Color:
                              rgb: 0,0,0
                          Rectangle:
                              pos:self.center_x-7, self.center_y-7
                              size:[14,14]                
                  
                      ''')
                  
                  class CustomCk(CheckBox): #define the class in the python file... 
                       pass
                  
                  checkb= CustomCk()
                  layout.add_widget(checkb)
                  

                  這篇關于Kivy:如何將畫布用于在 python 中創建的小部件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)

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

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

                      • <bdo id='PwLRy'></bdo><ul id='PwLRy'></ul>
                              <tbody id='PwLRy'></tbody>
                            <legend id='PwLRy'><style id='PwLRy'><dir id='PwLRy'><q id='PwLRy'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 九九免费| 成人午夜在线视频 | 在线播放中文字幕 | aaa天堂| 一本色道精品久久一区二区三区 | 97精品超碰一区二区三区 | 在线永久看片免费的视频 | 成年人在线播放 | 免费不卡av | 日日夜夜精品 | 农村黄性色生活片 | 日本一区二区三区视频在线 | 国产成人综合一区二区三区 | 黄色在线观看网址 | 欧美国产精品久久久 | 91传媒在线播放 | 欧美性视频在线播放 | 精品国模一区二区三区欧美 | 亚洲高清在线观看 | 精品国产欧美一区二区三区成人 | 91精品国产综合久久久久久 | 久久三区 | 成人午夜 | 国产精品久久久久永久免费观看 | 怡红院怡春院一级毛片 | 久久久久国产一区二区三区不卡 | 91精品国产美女在线观看 | 欧美视频网 | 久久精品成人一区 | 亚洲网站免费看 | 亚洲精品自在在线观看 | 欧美精品video | 国产一区二区三区四区三区四 | 精品美女视频在线观看免费软件 | 亚洲国产欧美一区 | 亚洲精品欧美精品 | 欧美日韩在线一区二区 | 国产在线视频一区二区董小宛性色 | 国产精品国产精品国产专区不卡 | 91性高湖久久久久久久久_久久99 | 日本精品视频在线观看 |