From: Mattia B. <mat...@li...> - 2006-08-11 20:37:32
|
On Tue, 08 Aug 2006 00:24:38 +0100 Mark Dootson <mar...@zn...> wrote: Hi, > Having said that, I would not choose 2 if that option represented much > more work than 1 or 3. It is somewhat more work, so I went for option 1 (quick and effective). Implementing a different solution is still possible, even for single classes. In addition to that, as Dan notes, some wxWidgets methods internally call functions in the underlying GUI toolkit, so event if the interaction with a cloned object is safe at the C++ level, it might not be at the GUI level, so option 1 is really the safest. > I assume we are only concerned with the listed object types and that Yes. > with any of the options, the following code in a secondary thread would > still work (I'm concerned about using Wx::Window::FindWindowById in the > context shown below) > > my $WINDOW_ID = (the ID of a window in my main gui thread); > my $window = Wx::Window::FindWindowById($WINDOW_ID, undef); > my $newevent = Wx::PlThreadEvent->new( -1, $MY_EVENT_ID, $sharedvar ); > Wx::PostEvent( $window, $newevent ); Well, this is not exactly the case I am discussing, since the objects in this example are not clones of the ones in the main thread; anyway using Wx::PostEvent will most definitely work in any wxPerl/threads scenario. Thanks to you and Dan for your input Mattia |