void SampleApp::OnAddButtonVClick() { sfg::Button::Ptr button( sfg::Button::Create( L"<- New" ) ); Ouchy::Ptr ouchy( new Ouchy( button ) ); Ouchy::m_ouchies.push_back( ouchy ); button->OnClick.Connect( &Ouchy::DoOuch, ouchy.get() ); m_boxbuttonsv->Pack( button, false ); }
void SampleApp::OnAddButtonHClick() { sfg::Button::Ptr button( sfg::Button::Create( L"New ->" ) ); Ouchy::Ptr ouchy( new Ouchy( button ) ); Ouchy::m_ouchies.push_back( ouchy ); button->GetSignal( sfg::Widget::OnLeftClick ).Connect( &Ouchy::DoOuch, ouchy.get() ); m_boxbuttonsh->Pack( button, true ); }