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

Method OnAddButtonHClick

examples/Test.cpp:612–629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

610}
611
612void SampleApp::OnAddButtonHClick() {
613 auto button = sfg::Button::Create( L"New ->" );
614
615 auto ouchy = std::make_shared<Ouchy>( button );
616 Ouchy::m_ouchies.push_back( ouchy );
617
618 std::weak_ptr<Ouchy> weak_ouchy = ouchy;
619
620 button->GetSignal( sfg::Widget::OnLeftClick ).Connect( [weak_ouchy] {
621 auto strong_ouchy = weak_ouchy.lock();
622
623 if( strong_ouchy ) {
624 strong_ouchy->DoOuch();
625 }
626 } );
627
628 m_boxbuttonsh->Pack( button, true );
629}
630
631void SampleApp::OnAddButtonVClick() {
632 auto button = sfg::Button::Create( L"<- New" );

Callers

nothing calls this directly

Calls 3

ConnectMethod · 0.80
DoOuchMethod · 0.80
PackMethod · 0.80

Tested by

no test coverage detected