Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6658433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:54:49+00:00 2026-05-26T01:54:49+00:00

I found wx.CallAfter and wx.CallLater in the documentation but neither solves my problem. What

  • 0

I found wx.CallAfter and wx.CallLater in the documentation but neither solves my problem.
What I’m trying to do is update a status bar while doing a task, but both wx.CallAfter and wx.CallLater only updates after task.

Example:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Fri Sep 30 20:55:34 2011

import wx
import time
# begin wxGlade: extracode
# end wxGlade



class MyFrame1(wx.Frame):
    def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrame1.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.frame_2_statusbar = self.CreateStatusBar(1, 0)

        self.__set_properties()
        self.__do_layout()
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: MyFrame1.__set_properties
        self.SetTitle("frame_2")
        self.frame_2_statusbar.SetStatusWidths([-1])
        # statusbar fields
        frame_2_statusbar_fields = ["foo"]
        for i in range(len(frame_2_statusbar_fields)):
            self.frame_2_statusbar.SetStatusText(frame_2_statusbar_fields[i], i)
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: MyFrame1.__do_layout
        self.Layout()
        # end wxGlade
    def Test(self):
    time.sleep(10)
        for i in range(0,100):
        time.sleep(0.1)
        txt="I <3 Stack Exchange x " +str( i)
        wx.CallAfter(self.frame_2_statusbar.SetStatusText,txt, 0)
        wx.CallAfter(self.Update)
        print txt
# end of class MyFrame1


if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    frame_1 = MyFrame1(None, -1, "")
    app.SetTopWindow(frame_1)
    frame_1.Show()
    wx.CallAfter(frame_1.Test)
    app.MainLoop()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:54:49+00:00Added an answer on May 26, 2026 at 1:54 am

    From the sound of it, “CallDuring” is nothing more than simply calling whatever function you want. It will get called exactly when you call it. Is there a reason why calling it directly doesn’t solve your problem?

    However, you’re telling your program to sleep. No amount of “call during” will help you since you’re putting the whole app to sleep. Maybe you think that sleep is a good simulation of “real” code, but it’s not. You’re actually telling your program “stop all processing”, which includes screen updates.

    The crux of your problem is that you’re not allowing the event loop to process redraw events. You might try calling wx.Yield() in your loop, but having a large, long-running loop in the main thread of a GUI program is a code smell. There’s almost certainly a better way to approach your problem.

    The best advice I can give is to search on “wxpython long running task”. Most likely the first hit will be a wxpywiki page titled “Long Running Tasks” that you might find helpful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Found some similar questions but no answers that work. Right now I am doing
Found quite a few links related but nothing in the area of how I
Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
Found a really nice code for Accordion nav and am trying implement on our
Found a bunch of other threads about comboboxes in WPF datagrid, but none that
Found more than 10 tutorials to cursors but I can't understand that. My question
Found this method of having DIV as custom google maps infoWindow. It works, but
Found a similar post here but I am running a Mac so the first
Found this official ACS demo http://www.fabrikamshipping.com/ while researching on ACS. In the app itself,
Found the function which position the image(s) in the multiscaleimage... but I'm not sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.