From: John L. <jla...@gm...> - 2005-08-01 23:04:47
|
On 8/1/05, klaas.holwerda <kho...@xs...> wrote: > I do understand more or less what you write. But i do not understand why > the wxLuaBinding i see now, is not good enough, which i think is the > case from what you have in mind. Don't get me wrong, i do not critisize > :-), just don't understand. > e.g. i see in wxbind.h > class wx_binding >=20 > Where did this wxLuaBinding class come from, it is not in my wxArt2D > version, so i assume Ray or you made it? Ray did, it's in modules/wxlua/include/internal.h and src/internal.cpp. The only problem is that in internal.cpp you have to know the name of the binding class in order to call it. This means that you can't compile without it. It also makes the #include "wxbind.h" necessary. I was just thinking out loud about how to dynamicly create a list of bindings and use the string namespace to differentiate between them. Now that I check it out a little more, it'd be much easier to to just have = a=20 static wxArrayString wxLuaBinding::ms_arrayBindingClassNames; every subclassed binding just adds it's own classname once to the binding list. Now that you know the class names of the bindings, each wxLuaStateVariables can create and add them to the m_bindings list by running wxObject * wxCreateDynamicObject(const wxString& className) All you need to have is that each subclassed wxLuaBinding class have DECLARE/IMPLEMENT_DYNAMIC_CLASS. Again, maybe this isn't perfect or even a good idea, I'm just thinking about how people can most simply add their own wrappers without having to modify anything in wxlua. As you can see, I really haven't played with the current system that much since I don't know how they'll change. I won't commit anything without consulting others, I just wanted to throw the idea out there. Regards, John Labenski |