MCPcopy Create free account
hub / github.com/TankOs/SFGUI / OnAddButtonVClick

Method OnAddButtonVClick

examples/Test.cpp:631–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631void SampleApp::OnAddButtonVClick() {
632 auto button = sfg::Button::Create( L"<- New" );
633
634 auto ouchy = std::make_shared<Ouchy>( button );
635 Ouchy::m_ouchies.push_back( ouchy );
636
637 std::weak_ptr<Ouchy> weak_ouchy = ouchy;
638
639 button->GetSignal( sfg::Widget::OnLeftClick ).Connect( [weak_ouchy] {
640 auto strong_ouchy = weak_ouchy.lock();
641
642 if( strong_ouchy ) {
643 strong_ouchy->DoOuch();
644 }
645 } );
646
647 m_boxbuttonsv->Pack( button, false );
648}
649
650void SampleApp::OnToggleTitlebarClick() {
651 m_wndmain->SetStyle( m_wndmain->GetStyle() ^ sfg::Window::TITLEBAR );

Callers

nothing calls this directly

Calls 3

ConnectMethod · 0.80
DoOuchMethod · 0.80
PackMethod · 0.80

Tested by

no test coverage detected