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 7930343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:23:29+00:00 2026-06-03T20:23:29+00:00

This is an excerpt from a source file of wxPython: Create the output window

  • 0

This is an excerpt from a source file of wxPython:

    """
    Create the output window if needed and write the string to it.
    If not called in the context of the gui thread then uses
    CallAfter to do the work there.
    """        

How does this work internally? Why is it important that GUI related calls are not made by other threads directly?

Do you know of a chart or something that explains such GUI concepts in a short, simple way?

I would love, if I not had to read a novel to understand this issue so that I know how to choose my design.


Edit:

This is for a discussion below:

Diagram

  • 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-06-03T20:23:30+00:00Added an answer on June 3, 2026 at 8:23 pm

    That’s pretty easy. Think of a queue, wxPython has it’s own internal Event-Queue, you cause wxPython to process it when calling MainLoop on your app, which will be called from the Main-Thread. So as whenever you modify a widget it will not interfere with the MainLoop which is processing the Event-Queue. But when you add Threads, more then one Thread is manipulating the GUI and/or the Event-Queue and GUI-access is not synchronized.
    That’s where wx.CallAfter gets useful, it simply adds an pseudo-event to the Event-Queue, which will call your specified function, so it will be executed from the Main-Thread and just one Thread is accessing the GUI. Note, when your passed function takes a while to return the GUI will freeze, because no more events (like movement or clicks) are processed.

    Related: http://wiki.wxpython.org/LongRunningTasks

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

Sidebar

Related Questions

I got an .ipa file from a customer (without source code access). This app
Greetings! I must be seeing things. Look at this excerpt from the iPhone OS
The following source file will not compile with the MSVC compiler (v15.00.30729.01): /* stest.c
So I was looking at an open source's csproj file and noticed this: <ProjectExtensions>
I have a maven pom file for an open source project. This pom file
This is an excerpt of some c++ code, that i'll have to explain in
I have this HTML structure (excerpt): <td> <select id=test1 class=pub_chooser> <option value=99>All Publications</option> <option
I am using emacs 23.2 with the GTK toolkit. I built emacs from source
In short: I want to generate two different source trees from the current one,
I got the source below from a third-party site explaining how to download a

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.