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

    • <bdo id='laFlN'></bdo><ul id='laFlN'></ul>

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

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

        在 Kivy 中構建簡單的進度條或加載動畫?

        Building a simple progress bar or loading animation in Kivy?(在 Kivy 中構建簡單的進度條或加載動畫?)
          <bdo id='tVfMh'></bdo><ul id='tVfMh'></ul>
              <tbody id='tVfMh'></tbody>
              1. <tfoot id='tVfMh'></tfoot>

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

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

                  本文介紹了在 Kivy 中構建簡單的進度條或加載動畫?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在為我開發的命令行實用程序編寫 Kivy UI.一切正常,但有些進程可能需要幾秒鐘到幾分鐘的時間來處理,我想向用戶提供一些指示,表明該進程正在運行.理想情況下,這將是一個旋轉輪或加載欄或其他東西的形式,但即使我可以更新我的顯示以向用戶顯示一個進程正在運行,它也會比我現在擁有的更好.

                  I am writing a Kivy UI for cmd line utility I have developed. Everything works fine, but some of the processes can take from a few seconds to a few minutes to process and I would like to provide some indication to the user that the process is running. Ideally, this would be in the form of a spinning wheel or loading bar or something, but even if I could update my display to show the user that a process is running, it would be better than what I have now.

                  目前,用戶在主 UI 中按下按鈕.這會彈出一個彈出窗口,向用戶驗證一些關鍵信息,如果他們對這些選項感到滿意,他們會按下運行"按鈕.我已經嘗試打開一個新的彈出窗口來告訴他們進程正在運行,但是因為在進程完成之前顯示不會更新,所以這不起作用.

                  Currently, the user presses a button in the main UI. This brings up a popup that verifies some key information with the user, and if they are happy with those options, they press a 'run' button. I have tried opening a new popup to tell them that the process is running, but because the display doesn't update until the process finishes, this doesn't work.

                  我有很多編碼經驗,但主要是在數學和工程方面,所以我對 UI 設計和處理事件和線程非常陌生.一個簡單的獨立示例將不勝感激.

                  I have a lot of coding experience, but mostly in the context of math and engineering, so I am very new to the designing of UIs and having to handle events and threads. A simple self-contained example would be greatly appreciated.

                  推薦答案

                  我最近正在解決你描述的問題:顯示在進程完成之前不會更新

                  I was recently tackling the problem you described: display doesn't update until the process finishes

                  這是我在#Kivy IRC 頻道中@andy_s 的幫助下完成的一個完整示例:

                  Here is a complete example that I got working with the help of @andy_s in the #Kivy IRC channel:

                  我的 main.py:

                  My main.py:

                  from kivy.app import App
                  from kivy.uix.popup import Popup
                  from kivy.factory import Factory
                  from kivy.properties import ObjectProperty
                  from kivy.clock import Clock
                  
                  import time, threading
                  
                  class PopupBox(Popup):
                      pop_up_text = ObjectProperty()
                      def update_pop_up_text(self, p_message):
                          self.pop_up_text.text = p_message
                  
                  class ExampleApp(App):
                      def show_popup(self):
                          self.pop_up = Factory.PopupBox()
                          self.pop_up.update_pop_up_text('Running some task...')
                          self.pop_up.open()
                  
                      def process_button_click(self):
                          # Open the pop up
                          self.show_popup()
                  
                          # Call some method that may take a while to run.
                          # I'm using a thread to simulate this
                          mythread = threading.Thread(target=self.something_that_takes_5_seconds_to_run)
                          mythread.start()
                  
                      def something_that_takes_5_seconds_to_run(self):
                          thistime = time.time() 
                          while thistime + 5 > time.time(): # 5 seconds
                              time.sleep(1)
                  
                          # Once the long running task is done, close the pop up.
                          self.pop_up.dismiss()
                  
                  if __name__ == "__main__":
                      ExampleApp().run()
                  

                  我的例子.kv:

                  AnchorLayout:
                      anchor_x: 'center'
                      anchor_y: 'center'
                      Button:
                          height: 40
                          width: 100
                          size_hint: (None, None)
                          text: 'Click Me'
                          on_press: app.process_button_click()
                  
                  <PopupBox>:
                      pop_up_text: _pop_up_text
                      size_hint: .5, .5
                      auto_dismiss: True
                      title: 'Status'   
                  
                      BoxLayout:
                          orientation: "vertical"
                          Label:
                              id: _pop_up_text
                              text: ''
                  

                  如果你運行這個例子,你可以點擊Click Me按鈕,它應該會打開一個模態/彈窗形式的進度條".此彈出窗口將保持打開 5 秒鐘而不會阻塞主窗口.5秒后,彈窗會自動消失.

                  If you run this example, you can click the Click Me button, which should open up a "progress bar" in the form of a modal/pop-up. This pop up will remain open for 5 seconds without blocking the main window. After 5 seconds, the pop up will automatically be dismissed.

                  這篇關于在 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 - 自動更改角色顏色)

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

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

                          <tfoot id='T3FnZ'></tfoot>

                          • <bdo id='T3FnZ'></bdo><ul id='T3FnZ'></ul>
                              <tbody id='T3FnZ'></tbody>
                            主站蜘蛛池模板: 欧美日韩久久久 | 欧美国产视频 | 日韩精品一区二区三区视频播放 | 色综合美女 | 国产真实精品久久二三区 | 中文字幕在线剧情 | 99re视频 | 波多野结衣一区二区 | 国产麻豆乱码精品一区二区三区 | 中文字幕 在线观看 | 成人在线视频免费看 | 成人免费毛片片v | 香蕉婷婷| 久久精品国产久精国产 | 一区二区三区久久 | 日日日视频 | 亚洲品质自拍视频 | 国产精品视频一二三区 | 人人爱干| 青青草视频网 | 日韩av资源站| 污污免费网站 | 精品久久久久久亚洲国产800 | 欧美一级高清片 | 亚洲高清在线 | yiren22 亚洲综合 | 国产乱码精品一品二品 | 五月婷婷丁香 | 永久免费视频 | 99热在这里只有精品 | 在线免费看黄 | www.日韩欧美 | 欧美黑人国产人伦爽爽爽 | 国产成人精品一区二区三区视频 | 久久久久九九九九 | 色噜噜亚洲男人的天堂 | 91亚洲视频在线 | 国产欧美一区二区三区另类精品 | 久久久久国产精品午夜一区 | 亚洲一区二区在线视频 | 91久久精品一区二区二区 |