forked from cnjinhao/nana-docs
-
Notifications
You must be signed in to change notification settings - Fork 6
Widget checkbox
James Bremner edited this page Apr 4, 2019
·
2 revisions
#include <nana/gui/widgets/checkbox.hpp>
/// Construct checkbox to be displayed in panel
nana::checkbox cb( panel );
/// move to location in panel
cb.move( { topleftX, topleftY, width, height } );
/// label the checkbox
cb.caption( "Toggle truth" );
/// respond when it is toggled
cb->events().click([this]
{
if( ! cb.checked() )
status.caption("false");
else
status.caption("true");
});