I have a thread whose output is redirected to a textCtrl.
How can I get an event (or something) when the textCtrl has been
drawn? I want to trigger the thread start after that.
-Dan
I have a thread whose output is redirected to a textCtrl.
How can I get an event (or something) when the textCtrl has been
drawn? I want to trigger the thread start after that.
-Dan
Dan Christian wrote:
I have a thread whose output is redirected to a textCtrl.
How can I get an event (or something) when the textCtrl has been
drawn? I want to trigger the thread start after that.
Not specifically, but there are a few ways you can get close. On wxGTK the EVT_WINDOW_CREATE will be sent when the widgets has been mapped on to the display. But on the other platforms that happens immediately, before the constructor returns, so you won't see that event there.
Probably the easiest way would be to use wx.CallAfter when the Show method of the frame containing the the textctrl is called. Pass it a function that will start the thread and whatever else you need to do at that time. The function will be called shortly after control returns to the event loop and pending events have been handled.
--
Robin Dunn
Software Craftsman
Thanks,
CallAfter worked for me.
-Dan
On Tue, Mar 19, 2013 at 11:50 PM, Robin Dunn <robin@alldunn.com> wrote:
Dan Christian wrote:
I have a thread whose output is redirected to a textCtrl.
How can I get an event (or something) when the textCtrl has been
drawn? I want to trigger the thread start after that.Not specifically, but there are a few ways you can get close. On wxGTK the
EVT_WINDOW_CREATE will be sent when the widgets has been mapped on to the
display. But on the other platforms that happens immediately, before the
constructor returns, so you won't see that event there.Probably the easiest way would be to use wx.CallAfter when the Show method
of the frame containing the the textctrl is called. Pass it a function that
will start the thread and whatever else you need to do at that time. The
function will be called shortly after control returns to the event loop and
pending events have been handled.--
Robin Dunn
Software Craftsman
http://wxPython.org--
You received this message because you are subscribed to the Google Groups
"wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.