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

  • <small id='5EM2C'></small><noframes id='5EM2C'>

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

    1. <tfoot id='5EM2C'></tfoot>

        如何在 Kivy 中隱藏 ActionButton?

        How to hide an ActionButton in Kivy?(如何在 Kivy 中隱藏 ActionButton?)
        • <i id='swsKs'><tr id='swsKs'><dt id='swsKs'><q id='swsKs'><span id='swsKs'><b id='swsKs'><form id='swsKs'><ins id='swsKs'></ins><ul id='swsKs'></ul><sub id='swsKs'></sub></form><legend id='swsKs'></legend><bdo id='swsKs'><pre id='swsKs'><center id='swsKs'></center></pre></bdo></b><th id='swsKs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='swsKs'><tfoot id='swsKs'></tfoot><dl id='swsKs'><fieldset id='swsKs'></fieldset></dl></div>
          • <bdo id='swsKs'></bdo><ul id='swsKs'></ul>

              <tbody id='swsKs'></tbody>

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

              <tfoot id='swsKs'></tfoot>

              • <legend id='swsKs'><style id='swsKs'><dir id='swsKs'><q id='swsKs'></q></dir></style></legend>
                  本文介紹了如何在 Kivy 中隱藏 ActionButton?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試根據當前屏幕(使用屏幕管理器)修改 ActionButton 的可見性.我找不到可以簡單地切換可見性的 Visible 屬性或類似的東西(對于 ActionButton 和一般的小部件都不是).

                  I am trying to modify the visibility of an ActionButton accordingly to the current screen (using Screen Manager). I could not find a Visible property or something like that that can simply toggle visibility (neither for ActionButton nor for Widgets in general) .

                  2013 年的一篇帖子 建議更改按鈕,但我不想依靠這樣的 hack 來完成這樣一個簡單的任務,而且我的應用程序的背景會是可變的.

                  A post from 2013 suggests changing the texture of the button, but I don't want to rely on such a hack to accomplish such a simple task, besides, the background of my app will be variable.

                  另一篇文章建議刪除小部件并根據需要再次添加.盡管它不必要的復雜性.我修改為適用于我的情況(ActionBar 和 ActionButton),所以我從 ActionView 中清除了小部件,然后嘗試添加 ActionButton.我嘗試同時存儲弱引用和 self 成員,但都出現以下錯誤:

                  Another post suggest removing the widget and adding it again as needed. Despite its unnecessary complexity. I modified to work in my case (ActionBar and ActionButton), so I clear the widgets from the ActionView and then try to add the ActionButton. I tried storing both a weakref and the self member, with both I got the following error:

                  WidgetException: Cannot add <kivy.uix.actionbar.ActionButton object at 0x7fcd3fe22ce8>, it already has a parent <kivy.uix.actionbar.ActionView object at 0x7fcd3fe22870>
                  

                  任何想法將不勝感激.我正在使用開發版本,但它不適用于 1.8.

                  Any idea would be greatly appreciated. I am working with the dev version, but it neither work with 1.8.

                  編輯我嘗試了以下代碼:

                  <AppActionBar>:
                      ActionView:
                          id: av
                  
                          ActionButton:
                              id: btn_next
                              text: 'Next screen'
                              icon: 'data/icons/next_dark.png'
                              important: True
                              on_release: app.go_next()
                  

                  該函數在場景加載后運行:

                  This function is run after the scene is loaded:

                  def _initialize(self):
                    self.next = self.ids.btn_next.__self__ # same result if I don't use .__self__
                  

                  此代碼引發了上面發布的異常:

                  This code raises the exception posted above:

                  self.ids.av.clear_widgets()
                  self.ids.av.add_widget(self.next)
                  

                  這是完整的異常跟蹤:

                       self._mainloop()
                     File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_pygame.py", line 266, in _mainloop
                       EventLoop.idle()
                     File "/usr/local/lib/python2.7/dist-packages/kivy/base.py", line 330, in idle
                       Clock.tick_draw()
                     File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 429, in tick_draw
                       self._process_events_before_frame()
                     File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 562, in _process_events_before_frame
                       if event.tick(self._last_tick) is False:
                     File "/usr/local/lib/python2.7/dist-packages/kivy/clock.py", line 309, in tick
                       ret = callback(self._dt)
                     File "/usr/local/lib/python2.7/dist-packages/kivy/uix/boxlayout.py", line 174, in do_layout
                       c.width = w
                     File "properties.pyx", line 345, in kivy.properties.Property.__set__ (kivy/properties.c:3589)
                     File "properties.pyx", line 377, in kivy.properties.Property.set (kivy/properties.c:4064)
                     File "properties.pyx", line 431, in kivy.properties.Property.dispatch (kivy/properties.c:4657)
                     File "/usr/local/lib/python2.7/dist-packages/kivy/uix/actionbar.py", line 552, in on_width
                       self._layout_all()
                     File "/usr/local/lib/python2.7/dist-packages/kivy/uix/actionbar.py", line 441, in _layout_all
                       super_add(child)
                     File "/usr/local/lib/python2.7/dist-packages/kivy/uix/boxlayout.py", line 212, in add_widget
                       return super(BoxLayout, self).add_widget(widget, index)
                     File "/usr/local/lib/python2.7/dist-packages/kivy/uix/layout.py", line 78, in add_widget
                       return super(Layout, self).add_widget(widget, index)
                     File "/usr/local/lib/python2.7/dist-packages/kivy/uix/widget.py", line 466, in add_widget
                       % (widget, parent))
                   WidgetException: Cannot add <kivy.uix.actionbar.ActionButton object at 0x7fecb5d6ed50>, it already has a parent <kivy.uix.actionbar.ActionView object at 0x7fecb5d6e8d8>
                  

                  推薦答案

                  如果目標是隱藏它們,從父級移除小部件不是一個好主意.當從 Kivy 樹結構中刪除某些內容時,它會被垃圾收集器拾取.您可以嘗試保留對它的引用,但從概念上講隱藏不同于刪除.

                  Removing widgets from parents is not a very good idea, if the goal is to hide them. When something is removed from the Kivy tree structure, it will be picked up by the garbage collector. You could try to keep a reference to it, but conceptually hidding is different from removing.

                  對我來說最好的解決方案是使用 opacity 屬性.它與可見屬性的原理類似,但更強大,因為它接受漸變(和動畫).

                  The best solution for me has been using the opacity property. It is kind of the same principle of a visible property but more powerful because it accepts gradients (and animations).

                  警告"是 您必須考慮到 Widget 仍然存在.它只是看不見的.在某些情況下,您可能想嘗試將 opacitydisabled 屬性結合使用.

                  The "caveat" is that you have to consider that the Widget is still there. It is just invisible. In some cases, you might want to try and combine the opacity with the disabled property.

                  Button:
                      opacity: 0
                      disabled: True # To make sure it doesn't capture events accidentally
                  

                  這篇關于如何在 Kivy 中隱藏 ActionButton?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)
                    <tbody id='Humyf'></tbody>

                    1. <tfoot id='Humyf'></tfoot>

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

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

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

                          • 主站蜘蛛池模板: 欧美亚洲视频 | 91精品国产一区二区三区动漫 | 午夜私人影院在线观看 | 久久久美女 | 午夜影院在线 | 在线视频国产一区 | 成年人精品视频 | 亚洲成人一级 | 免费久久久久久 | 久久成人一区 | 成人久久久 | 在线看片国产 | 亚洲导航深夜福利涩涩屋 | 精品国产91乱码一区二区三区 | 99精品在线观看 | 理论片免费在线观看 | 西西裸体做爰视频 | 欧美日韩国产一区二区三区 | 精品www| aaaaaa大片免费看最大的 | 福利视频三区 | 精品永久 | 国产97在线 | 日韩 | www.狠狠干 | 中文字幕1区2区3区 日韩在线视频免费观看 | 一区二区三区高清 | 久久国产高清视频 | 亚洲网站在线观看 | 日韩精品一区二区三区中文在线 | 日韩av免费在线电影 | 人人九九精 | 日韩av黄色 | 一级黄在线观看 | 偷拍自拍网站 | 成人激情视频免费在线观看 | 欧美一区二区三区在线 | 天天色av | 亚洲福利视频网 | av一级久久 | 午夜一区二区三区视频 | 国产日韩精品在线 |