From: klaas.holwerda <kho...@xs...> - 2005-12-29 16:25:17
|
Hi John, I got something working now, but still do not understand why i can not debug into lua code itself. The problem with my script was, that wx.a2dLuaWP:Message("blah blah") should be wxart2d.a2dLuaWP:Message("blah blah") Which has to do with the namespace. What is lua doing with the namespace in front? Is it a function too? But now the question is, how does lua feedback to me what is wrong with my script? Can you tell me what i should do to get some kind of feedback when my script is not right? I did define LuaHandler derived from wxLuaHandler, but nothing in there is called, i expected DisplayError() would do the trick, but it seems more is needed. On the static bindings i found the next. If i define in MyApp as i explained the binding: class MyApp { static wxart2d_binding m_wxart2dluab; } And initialize the static instance like this: wxart2d_binding MyApp::m_wxart2dluab; BUT NOT call m_binding.GetBindingList()->Append(&m_binding); Suddenly the next two become active, i can but a break point on the last, and it stops. class wxart2d_BindingInit { public: wxart2d_BindingInit() { m_binding.GetBindingList()->Append(&m_binding); } wxart2d_Binding m_binding; }; wxart2d_BindingInit s_wxart2d_BindingInit; i conclude from this, that linking somehow only includes the classes/libraries which are really used in the code/main program/exe. If not used from there, it is not linked in and the static wxart2d_BindingInit is also not called. And since my bindings for wxArt2D are in a seperate library called luawraps, my main program did not contain anything from that. I think this in fact makes sence, why would one link anything from a library which is not used. (well it only looks like it is not used, since it is only used from scripts ) So why is the initialization order not a problem in this case? Just Luck, they are initialized in the right order. But as soon if i take class wxart2d_BindingInit from my luawraps library and but it into my program , it is wrong again. All static stuff in the program is done first and next what is in the libraries, and it should be the other way around. I do not see the solution yet, but at least the problem is more clear :-) Regards, Klaas |