How do you keep a wx frame from not responding while the code is running in the background? ie a search or other demanding function.

How do you keep a wx frame from not responding while the code is running in the background? ie a search or other demanding function.

You can use a busy cursor so that the user can't click on anything within the application:

wx.BeginBusyCursor()
# Do all the stuff here
# Once complete:
wx.EndBusyCursor()

thanks for the post.. that definitely helps, the prog still goes non responsive sometimes tho.

thanks for the post.. that definitely helps, the prog still goes non responsive sometimes tho.

Ah I misread your question. I thought you were asking how to make the frame unresponsive (as in don't allow the user to give input).

The answer lies in spawning a thread to do your intensive processing and just allow your frame to hang out and wait for the thread to return a result.

Thanks, ihatehippies. That was really helpful.
Why do you hate hippies? :P

Because they're hypocrites. They believe in freedom only as long as you agree with them.(ie guns) They overturn cars and assault police officers at peace rallies. And they smell bad

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.