wxUpdateUIEvent with a ListBook

Vadim Zeitlin vadim at wxwidgets.org
Mon Apr 7 13:49:14 PDT 2008


On Mon, 7 Apr 2008 13:46:04 -0700 (PDT) Alejandro Mostovoi <a.mostovoi at yahoo.com.ar> wrote:

AM> Exactly, I'm connecting the wxUpdateUIEvent to the pages and not the Listbook:
AM> 
AM>   m_listbook->GetPage(0)->Connect(wxEVT_UPDATE_UI,
AM>                                  wxUpdateUIEventHandler(MyFrame::OnPanelUiChanged));

 Wait, I didn't notice this but you're connecting a MyFrame method to a
wxWindow (or some class deriving from it but definitely not MyFrame) --
this can't work (think about it, how can wxWidgets find the MyFrame object
to call this method on?). You need to pass MyFrame pointer as the "sink"
parameter of Connect().

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/



More information about the wx-users mailing list