John Labenski <jlabenski@...> writes: > > > It sounds like your wxWidgets build is incomplete for the media control. Did you build it yourself? You'll need to rebuild it, but take note of the warnings during the configure stage and install the devel libaries for gstreamer until configure says that nothing is missing. You may need libcairo for wxgcdc. > > The wxlua app should build is wxluafreeze built. Running $wxluafreeze editor.wx.lua is the same as running wxlua. > Again, I am w/o a computer or time for this week... > John > On Dec 27, 2011 5:23 AM, "Milind Gupta" <milind.gupta- re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: > Ok, Was finally able to run wxlua applications. They seem to be running but the media.wx.lua does not run. Gives the error: > > lua: media.wx.lua:131: attempt to call field 'wxMediaCtrl' (a nil value) > > stack traceback: > > media.wx.lua:131: in function 'main' > > media.wx.lua:305: in main chunk > > [C]: ? > > > Don't know why that is the case. Also don't have the wxlua executable anywhere. I only see wxluacan and wxluafreeze. I did skip the wxstedit compilation, maybe that prevented wxlua creation? Trying wxstedit compilation now but it just won't compile. First there were include files it could not find now I get this error on running make: > > > > g++ -o ../samples/stedit/wxstedit wxstedit_wxstedit.o -L../lib -L../lib - lwxcode_gtk2u_stedit-2.8 -L/usr/local/lib -pthread -lwx_gtk2u_stc-2.8 - lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu-2.8 > > /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libwx_gtk2u_stc-2.8.so: undefined reference to `wxGCDC::wxGCDC(wxWindowDC const&) <at> WXU_2.8' > > /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libwx_gtk2u_stc-2.8.so: undefined reference to `wxGCDC::SetPen(wxPen const&) <at> WXU_2.8' > /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libwx_gtk2u_stc-2.8.so: undefined reference to `wxGCDC::~wxGCDC() <at> WXU_2.8' > /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/libwx_gtk2u_stc-2.8.so: undefined reference to `wxGCDC::SetBrush(wxBrush const&) <at> WXU_2.8' > > collect2: ld returned 1 exit status > make: *** [../samples/stedit/wxstedit] Error 1 > > > > Any tips on how to get wxlua IDE? Thats the main thing I want to get. > > > > > Thanks, > Milind > > On Mon, Dec 26, 2011 at 11:01 AM, Milind Gupta <milind.gupta- re5jqeeqqe8avxtiumw...@public.gmane.org> wrote: > Hi John, > Thank you very much for your reply.t worked after that and so did make install. But now when I try the example on the wxLua website: > > > require("wx") > frame = wx.wxFrame(wx.NULL, wx.wxID_ANY, "wxLua Minimal Demo", > wx.wxDefaultPosition, wx.wxSize(450, 450), > wx.wxDEFAULT_FRAME_STYLE) > > > > -- create a simple file menu > local fileMenu = wx.wxMenu() > fileMenu:Append(wx.wxID_EXIT, "E&xit", "Quit the program") > -- create a simple help menu > > > local helpMenu = wx.wxMenu() > helpMenu:Append(wx.wxID_ABOUT, "&About", > "About the wxLua Minimal Application") > > -- create a menu bar and append the file and help menus > > > local menuBar = wx.wxMenuBar() > menuBar:Append(fileMenu, "&File") > menuBar:Append(helpMenu, "&Help") > -- attach the menu bar into the frame > frame:SetMenuBar(menuBar) > > > > -- create a simple status bar > frame:CreateStatusBar(1) > frame:SetStatusText("Welcome to wxLua.") > > -- connect the selection event of the exit menu item to an > > > -- event handler that closes the window > frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED, > function (event) frame:Close(true) end ) > -- connect the selection event of the about menu item > > > frame:Connect(wx.wxID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED, > function (event) > wx.wxMessageBox('This is the "About" dialog of the Minimal wxLua sample.', > > > "About wxLua", > wx.wxOK + wx.wxICON_INFORMATION, > frame) > end ) > > > >
It's been about 15 years since I've done anything in C, never touched C++ - but I think I figured out the original issue. ---- wxImageHistogram::iterator * self = (wxImageHistogram::iterator *)wxluaT_getuserdatatype(L, 1, wxluatype_wxImageHistogram_iterator); // call op_inc wxImageHistogram::iterator* returns = &((*self)++); // push the result datatype wxluaT_pushuserdatatype(L, returns, wxluatype_wxImageHistogram_iterator); ---- If I gather this correctly, you're trying to post increment that iterator, if this were a normal pointer it would work - But I'm guessing the iterator type has an operator overload for the ++ operator, ultimately calling a function, so (*self)++ is just a function call, the result of which is being casted to an pointer. the compiler is complaining that it has to "throw away" the intermediate value, to give you a pointer, and is refusing to do so. The fix.... ---- wxImageHistogram::iterator * self = (wxImageHistogram::iterator *)wxluaT_getuserdatatype(L, 1, wxluatype_wxImageHistogram_iterator); // call op_inc wxImageHistogram::iterator returns = (*self)++; // push the result datatype wxluaT_pushuserdatatype(L, &returns, wxluatype_wxImageHistogram_iterator); ---- grab the actual result from the iterator override, and then cast as a pointer for the "lua_push" phew.... I don't really miss this stuff at all ;) Here's hoping this is correct! ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users