Sorry for taking so long to reply on this. My solution was to ditch wx.BusyInfo, because it simply does not work as I think it should. I also considered the AGW solution, but that was very different from the native look-and-feel of the GUI, so I didn't look into this any further.
Here's how I made the "busy display" work for my case. My application works with a "main" window. So I decided to implement the "busy display" as part of my main window (code snipped below). Now I just use calls to frame_main.busy_box.activate( ... ), frame_main.busy_box.deactivate( ... ) and frame_main.busy_box.setup( ... ) to control the busy display from the main thread or from the separate long-running thread (wrapped into wx.CallAfter where necessary).
class frame_main(wx.Frame):
def __init__(self,app):
...
# Create "busy display" dialog box:
self.busy_box = busy_display(self)
...
--------------------------------------------------
class busy_display(wx.Dialog):
def __init__(self, parent):
# Create the dialog box
wx.Dialog.__init__(self, parent, style = wx.SIMPLE_BORDER )
self._panel = None
self.setup('Plase wait...')
self._is_active = False
def setup(self, infotext):
if self._panel is not None:
# kill the panel before recreating a new one:
self._panel.Destroy()
self._panel = wx.Panel(self, -1)
msg = wx.StaticText(self._panel, label=infotext, style=wx.ALIGN_CENTRE_HORIZONTAL )
h_sizer = wx.BoxSizer(wx.HORIZONTAL)
main_sizer = wx.BoxSizer(wx.VERTICAL)
h_sizer.Add(msg, 0, wx.CENTER)
main_sizer.Add((0,0), 1, wx.EXPAND)
main_sizer.Add(h_sizer, 0, wx.CENTER)
main_sizer.Add((0,0), 1, wx.EXPAND)
self._panel.SetSizer(main_sizer)
siz = main_sizer.ComputeFittingWindowSize(self)
siz.IncBy(wx.Size(80,50))
self.SetSize(siz)
def activate(self, message = 'Please wait...'):
# Show the dialog in modal mode
if not self._is_active:
self.setup(message)
self._is_active = True
self.ShowModal()
def deactivate(self):
# End the modal dialog (from the long-running process thread)
if self._is_active:
self.EndModal(0)
self._is_active = False