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

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

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

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

    1. <legend id='SlEZl'><style id='SlEZl'><dir id='SlEZl'><q id='SlEZl'></q></dir></style></legend>

      1. <tfoot id='SlEZl'></tfoot>
      2. Kivy 外部規(guī)則繼承

        Kivy outside rule inherence(Kivy 外部規(guī)則繼承)
        <tfoot id='ezXSN'></tfoot>
            <tbody id='ezXSN'></tbody>

            <bdo id='ezXSN'></bdo><ul id='ezXSN'></ul>
            <legend id='ezXSN'><style id='ezXSN'><dir id='ezXSN'><q id='ezXSN'></q></dir></style></legend>

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

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

                1. 本文介紹了Kivy 外部規(guī)則繼承的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  I want to specify a special button so I don't have to adjust every button I use, however I want it's event to trigger a function in a different class.

                  main.py

                  from kivy.app import App
                  from kivy.uix.button import Button
                  from kivy.uix.stacklayout import StackLayout
                  from kivy.properties import ObjectProperty
                  
                  
                  class FancyButton(Button):
                      imp = ObjectProperty(None)
                  
                  
                  class Important(StackLayout):
                  
                      def NoInspiration(self, smile):
                          print("Received: {}".format(smile))
                  
                  
                  class TestApp(App):
                      def build(self):
                          pass
                  
                  if __name__ == '__main__':
                      TestApp().run()
                  

                  test.kv (working)

                  #:kivy 1.9.0
                  
                  <FancyButton@Button>:
                      on_release: self.parent.NoInspiration(':)')
                  
                  
                  <Important>:
                      id: imp
                  
                      FancyButton:
                          text: "smiley"
                  
                  BoxLayout:
                      Important
                  

                  Received: :)

                  test.kv (not working)

                  #:kivy 1.9.0
                  
                  <FancyButton>:
                      on_release: self.parent.NoInspiration(':)')
                  
                  
                  <Important>:
                      id: imp
                  
                      BoxLayout:
                          FancyButton:
                              text: "smiley"
                  
                  BoxLayout:
                      Important
                  

                  In the 2nd test.kv I added 'BoxLayout:' in front of FancyButton and suddenly I get the error:

                  AttributeError: 'BoxLayout' object has no attribute 'NoInspiration'

                  Question

                  • Why does self.parent only refer to the direct parent and not < Important > in the 2nd example?
                  • How can I have on_release: in < FancyButton > point to the function NoInspiration() while keeping the function in < Important >?

                  Follow up questions

                  • Kivy rule inherence with add_widget()
                  • Kivy outside rule inherence 2

                  解決方案

                  Change the kv to this

                  <FancyButton>:
                      on_release: self.imp.NoInspiration(':)')
                  
                  
                  <Important>:
                      id: imp
                  
                      BoxLayout:
                          FancyButton:
                              text: "smiley"
                              imp: root
                  
                  BoxLayout:
                      Important
                  

                  這篇關(guān)于Kivy 外部規(guī)則繼承的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)
                  <tfoot id='NCtgz'></tfoot>
                    <i id='NCtgz'><tr id='NCtgz'><dt id='NCtgz'><q id='NCtgz'><span id='NCtgz'><b id='NCtgz'><form id='NCtgz'><ins id='NCtgz'></ins><ul id='NCtgz'></ul><sub id='NCtgz'></sub></form><legend id='NCtgz'></legend><bdo id='NCtgz'><pre id='NCtgz'><center id='NCtgz'></center></pre></bdo></b><th id='NCtgz'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NCtgz'><tfoot id='NCtgz'></tfoot><dl id='NCtgz'><fieldset id='NCtgz'></fieldset></dl></div>

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

                        <tbody id='NCtgz'></tbody>

                      • <legend id='NCtgz'><style id='NCtgz'><dir id='NCtgz'><q id='NCtgz'></q></dir></style></legend>
                          <bdo id='NCtgz'></bdo><ul id='NCtgz'></ul>

                          1. 主站蜘蛛池模板: 精久久久| 亚洲一区久久久 | 91免费观看 | 美日韩免费视频 | 99热碰 | 欧美一区二区久久 | 一级a性色生活片久久毛片波多野 | 国产清纯白嫩初高生视频在线观看 | www亚洲一区| 久草视频在线看 | 男人久久天堂 | 亚洲一区 中文字幕 | 国产日韩一区 | 天天久久 | 国产在线精品一区二区三区 | 97久久精品 | 欧美色综合一区二区三区 | 亚洲精品日韩欧美 | 羞羞色在线观看 | 99色视频| 国产美女久久久 | 欧美一区二区免费 | 精品久久久久香蕉网 | 日韩欧美网 | 亚洲不卡 | 日韩视频一区二区三区 | 四虎最新视频 | 一区二区精品在线 | 欧美久久久电影 | 国产一级大片 | 亚洲视频中文字幕 | 亚洲人成人网 | 久久久久久久久久久久久久久久久久久久 | 欧美激情一区二区三区 | 国产小视频精品 | 日韩在线免费 | 日韩精品一区二区三区在线播放 | 亚洲国产精品一区二区久久 | 亚洲综合无码一区二区 | 日韩影院一区 | 国产精品成人一区二区三区夜夜夜 |