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

      <legend id='63E1c'><style id='63E1c'><dir id='63E1c'><q id='63E1c'></q></dir></style></legend>

    1. <small id='63E1c'></small><noframes id='63E1c'>

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

      <tfoot id='63E1c'></tfoot>
        <bdo id='63E1c'></bdo><ul id='63E1c'></ul>
      1. 如何通過按鈕關閉 Kivy 彈出窗口?

        How to dismiss the Kivy pop-up via a Button?(如何通過按鈕關閉 Kivy 彈出窗口?)

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

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

            <tbody id='kEyoC'></tbody>
          <tfoot id='kEyoC'></tfoot>
        • <legend id='kEyoC'><style id='kEyoC'><dir id='kEyoC'><q id='kEyoC'></q></dir></style></legend>

                <i id='kEyoC'><tr id='kEyoC'><dt id='kEyoC'><q id='kEyoC'><span id='kEyoC'><b id='kEyoC'><form id='kEyoC'><ins id='kEyoC'></ins><ul id='kEyoC'></ul><sub id='kEyoC'></sub></form><legend id='kEyoC'></legend><bdo id='kEyoC'><pre id='kEyoC'><center id='kEyoC'></center></pre></bdo></b><th id='kEyoC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='kEyoC'><tfoot id='kEyoC'></tfoot><dl id='kEyoC'><fieldset id='kEyoC'></fieldset></dl></div>
                • 本文介紹了如何通過按鈕關閉 Kivy 彈出窗口?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個使用 Kivy 創建的彈出窗口,其中包含 2 個按鈕.用戶可以通過在彈出區域外按下 (auto_dismiss = True) 或單擊否"按鈕來關閉彈出窗口.選擇是"按鈕,將退出整個應用程序.

                  請看相關代碼:

                  類 ExitApp(App):def exit_confirmation(self):# popup 只能有一個 Widget.這可以通過添加 BoxLayout 來解決self.box_popup = BoxLayout(orientation = 'horizo??ntal')self.box_popup.add_widget(Label(text = "真的退出?"))self.box_popup.add_widget(按鈕(文字=是",on_press = ExitApp.exit,size_hint = (0.215, 0.075)))self.box_popup.add_widget(按鈕(文字=否",on_press = self.popup_exit.dismiss,size_hint=(0.215, 0.075)))self.popup_exit = Popup(title = "退出",內容 = self.box_popup,size_hint = (0.4, 0.4),auto_dismiss = 真)self.popup_exit.open()def 退出(自我):App.get_running_app().stop()

                  現在的問題在于按下否"按鈕.按下該按鈕時,代碼將退出并出現以下錯誤:

                  <塊引用>

                   on_press = self.popup_exit.dismiss,

                  AttributeError: 'Button' 對象沒有屬性 'popup_exit'

                  知道如何盡可能輕松地解決此問題嗎?

                  解決方案

                  你可以通過一個惰性函數來解決這個問題

                  on_press = lambda *args: self.popup_exit.dismiss()

                  這樣,僅在按下按鈕且 popup_exit 已就位時才會進行查找...

                  I have a pop-up created with Kivy, which contains 2 buttons. User can dismiss the pop-up by pressing outside of the pop-up area (auto_dismiss = True), or by clicking the "No" button. Selecting the "Yes" button, will exit the whole application.

                  Please see relevant code:

                  class ExitApp(App):
                  
                  def exit_confirmation(self):
                  
                      # popup can only have one Widget.  This can be fixed by adding a BoxLayout
                  
                      self.box_popup = BoxLayout(orientation = 'horizontal')
                  
                      self.box_popup.add_widget(Label(text = "Really exit?"))
                  
                      self.box_popup.add_widget(Button(
                          text = "Yes",
                          on_press = ExitApp.exit,
                          size_hint = (0.215, 0.075)))
                  
                      self.box_popup.add_widget(Button(
                          text = "No",
                          on_press = self.popup_exit.dismiss,
                          size_hint=(0.215, 0.075)))
                  
                      self.popup_exit = Popup(title = "Exit",
                          content = self.box_popup,
                          size_hint = (0.4, 0.4),
                          auto_dismiss = True)
                  
                      self.popup_exit.open()
                  
                  def exit(self):
                  
                      App.get_running_app().stop()
                  

                  The problem now lays with pressing the "No" button. When that is pressed, the code exits with this error:

                   on_press = self.popup_exit.dismiss,
                  

                  AttributeError: 'Button' object has no attribute 'popup_exit'

                  Any idea how I can fix this as easily as possible?

                  解決方案

                  You can solve this issue by a lazy function

                  on_press = lambda *args: self.popup_exit.dismiss()
                  

                  This way, the lookup will occur only when the button is pressed and popup_exit is already in place...

                  這篇關于如何通過按鈕關閉 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 - 自動更改角色顏色)
                    <tfoot id='EhYBv'></tfoot>
                      • <bdo id='EhYBv'></bdo><ul id='EhYBv'></ul>

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

                              <tbody id='EhYBv'></tbody>
                            主站蜘蛛池模板: 精品国产一级 | 日日干日日操 | 91精品国产自产精品男人的天堂 | 国产亚洲一区二区三区在线 | 午夜网 | 欧美成人精品在线 | 美女一区二区在线观看 | 日日骚网| 黄a免费看 | 99在线资源| 成年人的视频免费观看 | 香蕉一区二区 | 国产精品欧美一区二区 | 国产成人综合一区二区三区 | 一区二区精品 | 麻豆国产一区二区三区四区 | 免费成人高清在线视频 | 九九伦理片 | 毛片片 | 一级日批片 | 欧美电影免费观看高清 | 久久精品视频99 | 视频一区二区在线观看 | 亚洲一区二区精品视频 | 久久久久亚洲精品 | 成人在线观看免费视频 | 亚洲精品一 | 91精品一区二区三区久久久久久 | 成人免费视频在线观看 | 国产精品一区二区在线播放 | 免费一区二区 | 九九热最新地址 | 成人黄色a | 亚洲第一免费播放区 | 国产伦精品一区二区三毛 | 国产免费一区二区三区 | 涩涩视频在线看 | 91av视频在线观看 | 久久88| 一区二区三区四区免费视频 | 麻豆国产一区二区三区四区 |