forked from cnjinhao/nana-docs
-
Notifications
You must be signed in to change notification settings - Fork 6
Widget panel
James Bremner edited this page Apr 11, 2019
·
6 revisions
template<bool HasBackground> class panel;
Doxygen description of panel
This widget is an area where you can put other widgets which become children of the panel. There are actually two kinds of panel depending on the selected template parameter:
-
panel<true>
will transfer all the pixels from its rectangle to the screen, thus having effectively a background. -
panel<false>
will transfer only the pixels from the children to the screen, thus lacking effectively a background.
The usage in your code is the same, doesn't matter what you specify in the HasBackground
template parameter.
nana::panel<true> myPanel( fm );
nana::label myLabel( myPanel );
// position label in panel
myLabel.move( { 10,10, 100, 25 } )
// position the panel, label moves along with it
myPanel.move( {10,10,200,50} }