Hi John, It seems like I'll need to create a derived class for wxLuaApp (similar to wxLuaPrintout) and add those Mac* methods to that class. Then the app can be set using wxGetApp::SetInstance() method, which should trigger those Mac* methods as expected. This also eliminates the issue with getting the Lua state, but I still need to figure out how to initialize the application fields properly... Or is there a better way?
Paul. On Thu, May 5, 2016 at 10:59 PM, Paul K <paulclin...@yahoo.com> wrote: > Hi John, > >> 1. Memory leak in wxlua: >> http://sourceforge.net/p/wxlua/mailman/message/34430092/ >> 2. MacOpenFiles and related methods: >> http://sourceforge.net/p/wxlua/mailman/message/34559782/ >> 3. wxButton class is missing all the methods from wxAnyButton class >> 4. Several other methods missing: >> http://sourceforge.net/p/wxlua/mailman/message/32988247/ > > I've been making good progress updating wxlua API for wxwidgets 3.1.x > and have processed about dozen or so classes, so adding all the > missing methods is much less of a priority for me. > > I tried to add MacOpenFiles processing and ran into an issue with > getting access to the current Lua state. Here is what I currently > have: > > %override wxLua_wxApp_MacOpenFiles > void wxApp::MacOpenFiles(const wxArrayString& filenames) > { > wxLuaState m_wxlState = s_wxlState // <== not sure what to put here > > if (m_wxlState.Ok() && !m_wxlState.GetCallBaseClassFunction() && > m_wxlState.HasDerivedMethod(this, "MacOpenFiles", true)) > { > int nOldTop = m_wxlState.lua_GetTop(); > m_wxlState.wxluaT_PushUserDataType(this, wxluatype_wxApp, true); > m_wxlState.PushwxArrayStringTable(filenames); > > m_wxlState.LuaPCall(2, 0); > m_wxlState.lua_SetTop(nOldTop-1); // -1 to remove pushed > derived method func too > } > m_wxlState.SetCallBaseClassFunction(false); // clear flag always > } > %end > > I would have used s_wxlState, but it's "static" in the Lua module, so > not available outside of that file. It doesn't solve all the problems, > but it could set me on the right track. When I make s_wxlState > non-static, I do get a linker error about duplicate > wxApp::MacOpenFiles method, so any ideas on how to avoid this, would > be useful too. > > Paul. ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users