<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # Busy Cursors 本節介紹在應用程序的長時間運行部分中如何更改光標。 更改為繁忙的光標會向應用程序用戶提供一些反饋,否則他們可能會認為該應用程序已掛起,而不執行任何操作。其中一個在支持模塊的模塊級別包含以下代碼: ~~~ # 添加了允許將默認光標更改為繁忙光標的代碼。 # 格雷格·沃爾特斯(Greg Walters)在python編程示例中基于代碼手動添加了變量以指示較長的過程。 # 這些例程也可以在Greyson的pg頁中看到。158。 busyCursor = 'watch' preBusyCursors = None def busyStart(newcursor=None): '''我們首先檢查是否將值傳遞給newcursor。 如果沒有,我們默認使用busyCursor。 然后,我們遍歷busyWidgets元組,并將光標設置為所需的任何內容。''' global preBusyCursors if not newcursor: newcursor = busyCursor newPreBusyCursors = {} for component in busyWidgets: newPreBusyCursors[component] = component['cursor'] component.configure(cursor=newcursor) component.update_idletasks() preBusyCursors = (newPreBusyCursors, preBusyCursors) def busyEnd(): '''在這個例程中,我們基本上將busyWidget元組中的小部件的游標重置為默認游標''' global preBusyCursors if not preBusyCursors: return oldPreBusyCursors = preBusyCursors[0] preBusyCursors = preBusyCursors[1] for component in busyWidgets: try: component.configure(cursor=oldPreBusyCursors[component]) except KeyError: pass component.update_idletasks() # 繁忙游標代碼的結尾。 ~~~ 并將以下代碼行插入支持模塊的“ init”中: ~~~ global busyWidgets busyWidgets = (top, ) ~~~ 第一行在函數頂部附近,并且在創建根對象之后插入對busyWidgets的分配。 在我的一個應用程序中,函數“ init”如下所示: ~~~ def init(top, gui): ''' 創建用于定期更新GUI的線程的功能。''' global t global w, top_level global busyWidgets w = gui top_level = top t = threading.Thread(target=fill_window,) t.start() busyWidgets = (top, w.Scrolledtext1) ~~~ 上面的最后一行將全局變量busyWidgets設置為我希望顯示busy光標的那些小部件的元組。 這是來自示例wcpe的示例,在該示例中,我希望忙碌的光標出現在頂級窗口以及Scrolledtextbox中。當啟動一段可能長時間運行的代碼段(繁忙部分)時,請在開始處插入以下內容: ~~~ busyStart() ~~~ 當離開繁忙的部分時,請在最后一個statement()中進行以下操作: ~~~ busyEnd() ~~~ 顯然,一個應用程序可能有許多忙碌的部分,它們可能與特定功能一致或不一致。 可以通用使用此代碼以使用任何Tkinter游標。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看