in general I seek until death the solution to my problem but the last test I've done disappoint me a lot
In on version 0.7.1 on Svn source
here's my function :
Code: Select all
void ManagerGui::RegisterCloseAction(
const std::string & window_name,
HandleFunction close_function
)
{
CEGUI::Window
* gui_sheet = CEGUI::System::getSingleton().getGUISheet();
if ( gui_sheet != Null )
{
CEGUI::FrameWindow
* frame_window = static_cast<CEGUI::FrameWindow *>( gui_sheet->getChildRecursive( window_name ) );
frame_window->subscribeEvent( CEGUI::FrameWindow::EventCloseClicked, boost::bind( &ManagerGui::OnChange, this, _1, close_function ) );
}
}
when the event is thrown it call the function OnChange that call the function handle_function
Code: Select all
Bool ManagerGui::OnChange(
const CEGUI::EventArgs & event_args,
HandleFunction handle_function
)
{
if ( handle_function )
{
handle_function();
return True;
}
return False;
}
the problem is the subscribe function :
Code: Select all
frame_window->subscribeEvent( CEGUI::FrameWindow::EventCloseClicked, boost::bind( &ManagerGui::OnChange, this, _1, close_function ) );
does not work ... the function OnChange is never called but if I change CEGUI::FrameWindow::EventCloseClicked into CEGUI::FrameWindow::EventActivated then it works well
so far it seems that the subscribtion goes well and that when the "x" button is clicked the function
Code: Select all
void FrameWindow::onCloseClicked(WindowEventArgs& e)
{
fireEvent(EventCloseClicked, e, EventNamespace);
}
is called
but nothing that called my function
Best regard
hades