On 3/26/07, Matthew Wild <[EMAIL PROTECTED]> wrote: > It almost feels like I'm spamming the list, sorry about that :/
It's ok, I try to read every day, but sometimes other things take precedence. :) > I found a great example of it here: > http://wxlua.cvs.sourceforge.net/wxlua/wxLua/samples/luamodule.wx.lua?revision=1.3&view=markup Also, check out wxLua/utils/wrapmodule/wrapmodule.lua. > One thing I'm banging my head about though, and unable to find any examples, > how can I let parts of my script run in OnRun, or on idle events? I've tried > several things, and none seem to do anything. Any ideas? You may be approaching wxWidgets (or in general GUI programming) wrong. Basicly, most GUI programs run a message pump/loop. What this means is that while you are continuously running code (eg. while(1) do print("hi") end) the GUI elements will not respond. You have to let the underlying system get a little time for processing redraw events, mouse events, etc. If you look at the samples you'll see that all of them finish completely and the only reason that they don't exit is that a top level window (wxFrame or wxDialog) still exists. After creating the GUI elements the program is idle and only responds to user interaction. If you need continuous processing you can try using coroutines, but better yet use wxEVT_IDLE for any random window you like since once connected they'll get the event every time that wxWidgets has finished processing the GUI events. myWindow:Connect(wx.wxEVT_IDLE, function(event) do stuff if (need_more) then event:RequestMore() -- but NOT ALWAYS end end) Try starting with the minimal sample and build up from there, testing the whole while. When you "break" something you'll quickly know what did it. Of course, if something is broken with wxLua let us know so we can fix it. > PS. Have you ever thought of an IRC/Jabber channel for wxLua? I dunno how much use it'd be since there might not be anyone listening. :( Hope this helps, John Labenski > > On 3/27/07, Matthew Wild <[EMAIL PROTECTED] > wrote: > > > > > > > > On 3/26/07, Matthew Wild <[EMAIL PROTECTED]> wrote: > > > Ok, sorry it's been a while. Today I finally got to focus on the wxLua > part of my application :) > > > > > > I found wxLua/modules/luamodule/src. Is this what I think it is? It > seems so. I built it, but although I can require() it, and my program runs, > absolutely nothing graphical happens. Any idea? > > > > > > > Hmm, I got something to work. I realised the script actually has to finish > before anything is displayed. When loaded as a module though, still > absolutely nothing happens. Is there some function I can call to start the > ball rolling? > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > wxlua-users mailing list > wxlua-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wxlua-users > > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users