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

      <small id='7lVXe'></small><noframes id='7lVXe'>

      <tfoot id='7lVXe'></tfoot>
      <legend id='7lVXe'><style id='7lVXe'><dir id='7lVXe'><q id='7lVXe'></q></dir></style></legend>
      • <bdo id='7lVXe'></bdo><ul id='7lVXe'></ul>

    1. <i id='7lVXe'><tr id='7lVXe'><dt id='7lVXe'><q id='7lVXe'><span id='7lVXe'><b id='7lVXe'><form id='7lVXe'><ins id='7lVXe'></ins><ul id='7lVXe'></ul><sub id='7lVXe'></sub></form><legend id='7lVXe'></legend><bdo id='7lVXe'><pre id='7lVXe'><center id='7lVXe'></center></pre></bdo></b><th id='7lVXe'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7lVXe'><tfoot id='7lVXe'></tfoot><dl id='7lVXe'><fieldset id='7lVXe'></fieldset></dl></div>
    2. 如何使用 Kivy 制作工具提示?

      How to make ToolTip using Kivy?(如何使用 Kivy 制作工具提示?)
        • <i id='IcOhr'><tr id='IcOhr'><dt id='IcOhr'><q id='IcOhr'><span id='IcOhr'><b id='IcOhr'><form id='IcOhr'><ins id='IcOhr'></ins><ul id='IcOhr'></ul><sub id='IcOhr'></sub></form><legend id='IcOhr'></legend><bdo id='IcOhr'><pre id='IcOhr'><center id='IcOhr'></center></pre></bdo></b><th id='IcOhr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IcOhr'><tfoot id='IcOhr'></tfoot><dl id='IcOhr'><fieldset id='IcOhr'></fieldset></dl></div>

              <tbody id='IcOhr'></tbody>
            <tfoot id='IcOhr'></tfoot>

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

              <bdo id='IcOhr'></bdo><ul id='IcOhr'></ul>
            • <legend id='IcOhr'><style id='IcOhr'><dir id='IcOhr'><q id='IcOhr'></q></dir></style></legend>
              • 本文介紹了如何使用 Kivy 制作工具提示?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                當鼠標指針懸停在 ActionBar 中的圖標上時,我希望在 Qt 中看到工具提示.
                是的,我可以使用 mode='spinner',但圖標更好.

                I want to see tooltip as in Qt when the mouse pointer is hovering over icon in ActionBar.
                Yes, I can use mode='spinner', but icons are nicer.

                推薦答案

                一個可以改進和擴展的簡單示例:

                A simple example you can improve and extend:

                from kivy.app import App
                from kivy.lang import Builder
                from kivy.uix.widget import Widget
                from kivy.core.window import Window
                from kivy.uix.actionbar import ActionButton
                from kivy.uix.label import Label
                from kivy.clock import Clock
                
                Builder.load_string("""
                <Tooltip>:
                    size_hint: None, None
                    size: self.texture_size[0]+5, self.texture_size[1]+5
                    canvas.before:
                        Color:
                            rgb: 0.2, 0.2, 0.2
                        Rectangle:
                            size: self.size
                            pos: self.pos
                
                <MyWidget>
                    ActionBar:
                        ActionView:
                            MyActionButton:
                                icon: 'atlas://data/images/defaulttheme/audio-volume-high'
                            MyActionButton:
                                icon: 'atlas://data/images/defaulttheme/audio-volume-high'                
                """)
                
                class Tooltip(Label):
                    pass
                
                class MyActionButton(ActionButton):
                    tooltip = Tooltip(text='Hello world')
                
                    def __init__(self, **kwargs):
                        Window.bind(mouse_pos=self.on_mouse_pos)
                        super(ActionButton, self).__init__(**kwargs)
                
                    def on_mouse_pos(self, *args):
                        if not self.get_root_window():
                            return
                        pos = args[1]
                        self.tooltip.pos = pos
                        Clock.unschedule(self.display_tooltip) # cancel scheduled event since I moved the cursor
                        self.close_tooltip() # close if it's opened
                        if self.collide_point(*self.to_widget(*pos)):
                            Clock.schedule_once(self.display_tooltip, 1)
                
                    def close_tooltip(self, *args):
                        Window.remove_widget(self.tooltip)
                
                    def display_tooltip(self, *args):
                        Window.add_widget(self.tooltip)
                
                
                class MyWidget(Widget):
                    pass
                
                class ClientApp(App):
                    def build(self):
                        return MyWidget()
                
                if __name__ == '__main__':
                    ClientApp().run()
                

                首先我將 on_mouse_pos 方法綁定到 Window.mouse_pos 事件,以便我可以檢測鼠標光標何時懸停在我的 ActionButton 子類上.這是基于這個片段.然后,如果我不移動光標,我會使用 Clock.schedule_once() 安排一個動作,以使我的工具箱可見.為了顯示,我只是將 Label 的子類添加到小部件堆棧中.您可以用更復雜的方法替換 display_tooltip()close_tooltip() 方法.

                First I bind on_mouse_pos method to Window.mouse_pos event so I can detect when the mouse cursor hovers over my subclass of ActionButton. This is based on this snippet. Then I shedule an action with Clock.schedule_once() to make my toolbox visible if I won't move my cursor. To display I'm just adding a subclass of Label to the stack of widgets. You can replace display_tooltip() and close_tooltip() methods with more sophisticated ones.

                將代碼相應地更新為 this answer

                這篇關于如何使用 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 - 自動更改角色顏色)
                  <tbody id='JEKwc'></tbody>
                <i id='JEKwc'><tr id='JEKwc'><dt id='JEKwc'><q id='JEKwc'><span id='JEKwc'><b id='JEKwc'><form id='JEKwc'><ins id='JEKwc'></ins><ul id='JEKwc'></ul><sub id='JEKwc'></sub></form><legend id='JEKwc'></legend><bdo id='JEKwc'><pre id='JEKwc'><center id='JEKwc'></center></pre></bdo></b><th id='JEKwc'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JEKwc'><tfoot id='JEKwc'></tfoot><dl id='JEKwc'><fieldset id='JEKwc'></fieldset></dl></div>

                  • <small id='JEKwc'></small><noframes id='JEKwc'>

                      <tfoot id='JEKwc'></tfoot>

                        <legend id='JEKwc'><style id='JEKwc'><dir id='JEKwc'><q id='JEKwc'></q></dir></style></legend>

                        • <bdo id='JEKwc'></bdo><ul id='JEKwc'></ul>
                        • 主站蜘蛛池模板: 啪啪网页 | 免费观看www| 午夜专区| 亚洲精品视频网站在线观看 | 久久久久久久一区二区 | 成人精品在线视频 | 国产中文字幕av | 欧美精品在线免费 | 成人影院免费视频 | 国产精品久久久久久久久久久久久 | 国产高清性xxxxxxxx | 天天干天天操天天射 | 中文字幕日韩欧美一区二区三区 | 人人干人人看 | 精品一二区 | 日韩精品一区二区三区在线观看 | 成人二区| 久久99蜜桃综合影院免费观看 | 亚洲欧美精品久久 | 国产中文字幕亚洲 | 91色站| 亚洲精品电影网在线观看 | 午夜视频免费在线 | 日韩中文字幕 | 一区二区三区免费 | 91视频免费在观看 | 国产精品免费视频一区 | av中文天堂 | 国产精品区二区三区日本 | 亚洲欧美视频一区二区 | 国产91久久久久 | 91精品国产色综合久久 | 国内激情av片 | a级片在线观看 | 亚洲伊人精品酒店 | 精品一区在线免费观看 | 国产精品美女久久久久久免费 | 91精品国产一区二区三区动漫 | 久久精品国产99国产 | 狠狠操狠狠干 | 精品自拍视频在线观看 |