On 5/13/08, John Labenski <[EMAIL PROTECTED]> wrote: > On Thu, May 8, 2008 at 5:30 PM, Mateusz Czaplinski <[EMAIL PROTECTED]> > wrote: >> I'm trying to play with wxSocket, but have strange results. The >> fragment of code which I attached works perfectly well when run from >> wxluaedit.exe (2.8.7.0-MSW-bin) but hangs after displaying the first >> message ("connect: true") when run from any other tool (wxlua, >> wxluafreeze, also embedded using wxluafreeze). > > That is strange, what happens if you add a menu item (see minimal > sample or even a button) so that you have to click it before > connecting? I just tried it in Linux and you code works fine for all > three programs. Maybe it's a MSW thing with initializing? > > wxLua and wxLuaFreeze, like typical C++ apps, run the Lua code to > create the GUI in the wxApp::OnInit() function which is called before > the mainloop is run. I wonder if this is why wxSocket works in > wxLuaEdit and not the others. > > Let me know
You're right, it worked when made to run from an event handler of a button - thanks a lot! It appears it never occured to me to think about when the Lua code is actually run... and what you write about that sounds possible, so maybe my problem was because some things in Wx were not properly initialized yet during this OnInit() method. And then, if I still want to connect immediately after starting the program, I suppose I should probably look for some timer or something similar (sounding like SwingUtils.invokeLater() ;) thanks very much again! and sorry for my response being so late. greetings Mateusz Czaplinski PS. Ah, I've also attached the file after applying the changes you described; who knows, it may even help someone else in a similar situation in future greetz - MC
test02.lua
Description: Binary data
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php
_______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users