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

      <tfoot id='mg0ci'></tfoot>

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

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

        Kivy AttributeError:“超級"對象在 ScreenManager 中沒

        Kivy AttributeError: #39;super#39; object has no attribute #39;__getattr__#39; with ScreenManager(Kivy AttributeError:“超級對象在 ScreenManager 中沒有屬性“__getattr__)
          <i id='hvI7w'><tr id='hvI7w'><dt id='hvI7w'><q id='hvI7w'><span id='hvI7w'><b id='hvI7w'><form id='hvI7w'><ins id='hvI7w'></ins><ul id='hvI7w'></ul><sub id='hvI7w'></sub></form><legend id='hvI7w'></legend><bdo id='hvI7w'><pre id='hvI7w'><center id='hvI7w'></center></pre></bdo></b><th id='hvI7w'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hvI7w'><tfoot id='hvI7w'></tfoot><dl id='hvI7w'><fieldset id='hvI7w'></fieldset></dl></div>
          <legend id='hvI7w'><style id='hvI7w'><dir id='hvI7w'><q id='hvI7w'></q></dir></style></legend>
            <tfoot id='hvI7w'></tfoot>

                  <tbody id='hvI7w'></tbody>

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

                  <bdo id='hvI7w'></bdo><ul id='hvI7w'></ul>
                • 本文介紹了Kivy AttributeError:“超級"對象在 ScreenManager 中沒有屬性“__getattr__"的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試將方法綁定到微調器的文本值.它需要在不遲于顯示 TestScreen 時綁定.如果我不使用 ScreenManager,這將有效(例如,如果 TestApp.build 返回 TestScreen 而不是 TestScreenManager).當 TestApp.build 返回 TestScreenManager 時,當我在 TestScreen.__init__

                  I am attempting to bind a method to the text value of a spinner. It needs to be bound no later than when the TestScreen is displayed. This works if I don't use the ScreenManager, (eg if TestApp.build returns TestScreen instead of TestScreenManager). When TestApp.build returns TestScreenManager I get the following error when I reference self.ids in TestScreen.__init__

                  AttributeError: 'super' object has no attribute '__getattr__'
                  

                  Test.py

                  from kivy.uix.screenmanager import Screen, ScreenManager
                  from kivy.app import App
                  
                  
                  class TestScreen(Screen):
                      def __init__(self, *args, **kwargs):
                          super(TestScreen, self).__init__(*args, **kwargs)
                          self.ids.test_spinner.bind(text=self.on_spinner_select)
                  
                      def on_spinner_select(self, instance, data, *largs):
                          print("In on_spinner_select")
                  
                      def print_spinner_value(self):
                          print(self.ids.test_spinner.text)
                  
                  
                  class TestScreenManager(ScreenManager):
                      pass
                  
                  
                  class TestApp(App):
                      def build(self):
                          #return TestScreen()
                          return TestScreenManager()
                  
                  
                  if __name__ == "__main__":
                      TestApp().run()
                  

                  Test.kv

                  <TestScreen>:
                      name: "World Screen"
                  
                      BoxLayout:
                          orientation: 'vertical'
                  
                          Label:
                              text: "Name"
                              font_size: 30
                  
                          BoxLayout:
                              Label:
                                  text: "Active Selection"
                                  size_hint_x: .5
                  
                              Spinner:
                                  id: test_spinner
                                  text: "Value1"
                                  values: ["Value1", "Value2"]
                  
                          Button:
                              text: "Print spinner value"
                              on_press: root.print_spinner_value()
                  
                  
                  <TestScreenManager>:
                      TestScreen:
                  

                  我嘗試在 on_enter 方法中綁定該方法,但我得到了同樣的錯誤.但是,如果我在 init 函數中注釋掉 self.ids 語句,self.ids 在方法 print_spinner_value 中確實有效.

                  I have tried binding the method in the on_enter method but I get the same error. However, self.ids does work in the method print_spinner_value if I comment out the self.ids statement in the init function.

                  目前我可以通過每次按下微調器時綁定函數來找到解決方法.但這似乎不是解決問題的最佳方法

                  Currently I was able to find a work around by binding the function every time the spinner is pressed. But that doesn't seem like the best way to handle the problem

                  on_press: self.bind(text=root.on_spinner_select)
                  

                  所以我的問題是:如何在使用 ScreenManager 時將方法綁定到加載的微調器?

                  So my question is: How do I bind a method to the spinner on load while using the ScreenManager?

                  推薦答案

                  我猜你嘗試綁定這個方法的時候你的屏幕初始化還沒有完成.試試這個:

                  I guess the init of your screen hasn't finished when you try to bind this method. Try this:

                  ...
                  from kivy.clock import Clock
                  ...
                  class TestScreen(Screen):
                      def __init__(self, **kwargs):
                          super(TestScreen, self).__init__(**kwargs)
                          Clock.schedule_once(self.on_start)
                  
                      def on_start(self, *args):
                          self.ids.test_spinner.bind(text=self.on_spinner_select)
                  

                  這篇關于Kivy AttributeError:“超級"對象在 ScreenManager 中沒有屬性“__getattr__"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='H1dX5'></small><noframes id='H1dX5'>

                • <tfoot id='H1dX5'></tfoot>
                    <tbody id='H1dX5'></tbody>
                      <bdo id='H1dX5'></bdo><ul id='H1dX5'></ul>

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

                        1. <legend id='H1dX5'><style id='H1dX5'><dir id='H1dX5'><q id='H1dX5'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 国产一区二区三区免费观看视频 | 伊人网影院 | 久久久久国产一区二区三区不卡 | 亚洲精品视频在线看 | 日韩一级免费看 | 国产精品久久久久久久模特 | av黄色网 | 久久综合一区二区 | 欧美a在线| 国产1区2区3区 | 中文在线一区二区 | 成人性视频免费网站 | 国产一区在线看 | 中文字幕欧美日韩一区 | 国产成人精品一区二区三区在线 | av官网在线| 91pao对白在线播放 | 欧美视频日韩 | 在线欧美小视频 | 久久亚洲美女 | 久草成人 | 国产免费看 | 久久精品久久久久久 | 午夜日韩视频 | 99一区二区 | 美女精品一区 | 第一福利社区1024 | 久久综合一区二区 | 国产小视频自拍 | 国产精品久久久久婷婷二区次 | 国产婷婷色综合av蜜臀av | 精品在线免费观看视频 | 久久国产高清 | 成人国产精品 | 亚洲国产精品久久 | 福利视频网 | 成人福利网| 91精品国产综合久久久亚洲 | 久久久久久久av麻豆果冻 | 毛片免费视频 | 最近中文字幕在线视频1 |