以下の内容はhttps://feynman.hatenablog.com/entry/2022/09/17/155515より取得しました。


wxpythonのwx.CallLater

wxpythonのwx.CallAfter - メグタンの何でもブログ の続き

ディレイを入れて実行するwx.CallLater

wx.CallLaterでは指定したms後に処理を行うことができる。
自身の中で繰り返しリスタートする事でwx.Timerの様に定期実行ができる。
メインスレッド(UIスレッド)のみから実行できる。

    def m_button1OnButtonClick( self, event ):
        self.count = 0
        wx.CallLater(100, self.laterTimer)
    def laterTimer(self):
        print('laterTimer id: {0}'.format(th.get_ident()))
        self.count = self.count + 1
        if self.count == 100:
            return
        self.m_gauge1.SetValue(self.count)
        wx.CallLater(100, self.laterTimer)

wx.CallLater
wx.CallLater — wxPython Phoenix 4.2.0 documentation




以上の内容はhttps://feynman.hatenablog.com/entry/2022/09/17/155515より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14