Hi,

I'm experiencing some strange behaviour when trying to print class names of
wxWindow objects from the wxLuaWinDestroyCallback constructor and destructors.
I think this has to do with my lack of knowledge about C++ so I'd be glad if
someone could explain to me why this happens.

I added the following three printf()'s to wxlcallb.cpp:

1) In wxLuaWinDestroyCallback::wxLuaWinDestroyCallback:
printf("*** CONSTRUCTOR: %p NAME: %s\n", m_window, 
m_window->GetClassInfo()->GetClassName());
    
2) In wxLuaWinDestroyCallback::~wxLuaWinDestroyCallback():
printf("*** DESTRUCTOR: %p NAME: %s\n", m_window, 
m_window->GetClassInfo()->GetClassName());

3) In void wxLuaWinDestroyCallback::OnAllDestroyEvents(wxWindowDestroyEvent& 
event):
printf("*** ONALLDESTROY: %p NAME: %s\n", theCallback->m_window, 
theCallback->m_window->GetClassInfo()->GetClassName());
     
For wxWindow of type wxFrame I get the following output:

*** CONSTRUCTOR: 03C7EE18 NAME: wxFrame
*** ONALLDESTROY: 03C7EE18 NAME: wxWindow
*** DESTRUCTOR: 03C7EE18 NAME: wxEvtHandler

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?

Thanks!

-- 
Best regards,
 Andreas Falkenhahn                          mailto:andr...@falkenhahn.com


------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to