From: John L. <jla...@gm...> - 2013-08-26 03:51:35
|
On Sun, Aug 25, 2013 at 6:42 AM, Andreas Falkenhahn <an...@fa...> wrote: ... > > > What is confusing me here is this: The m_window pointer is always the same but in each > callback I get a different class name. How can this be? I'd expect to get "wxFrame" > in each callback but instead I get "wxFrame" only in the constructor. In the other > two callbacks it is "wxWindow" and then even "wxEvtHandler".... I don't understand > this. What is going on there? > The window is just being cast to different types, It looks like the GetClassInfo() function is virtual, as defined in wxDECLARE_ABSTRACT_CLASS, so it returns whatever the object is cast to at that time, which is what you see. C++ doesn't really know what type any particular object really is. The first case where the object is passed by wxWindow* pointer to the wxLuaWinDestroyCallback seems odd, but it's a wxFrame that being passed in and the wxWindow* arg doesn't really make a new pointer object, it just passes the frame though it. Regards, John |