<s> from muntjac . api import VerticalLayout , CheckBox <EOL> from muntjac . terminal . theme_resource import ThemeResource <EOL> from muntjac . ui . button import IClickListener <EOL> class CheckBoxesExample ( VerticalLayout , IClickListener ) : <EOL> _CAPTION = '<STR_LIT>' <EOL> _TOOLTIP = '<STR_LIT>' <EOL> _ICON = ThemeResource ( '<STR_LIT>' ) <EOL> def __init__ ( self ) : <EOL> super ( CheckBoxesExample , self ) . __init__ ( ) <EOL> self . setSpacing ( True ) <EOL> cb = CheckBox ( self . _CAPTION ) <EOL> cb . setDescription ( self . _TOOLTIP ) <EOL> cb . setImmediate ( True ) <EOL> cb . addListener ( self , IClickListener ) <EOL> self . addComponent ( cb ) <EOL> cb = CheckBox ( self . _CAPTION ) <EOL> cb . setDescription ( self . _TOOLTIP ) <EOL> cb . setIcon ( self . _ICON ) <EOL> cb . setImmediate ( True ) <EOL> cb . addListener ( self , IClickListener ) <EOL> self . addComponent ( cb ) <EOL> cb = CheckBox ( ) <EOL> cb . setDescription ( self . _TOOLTIP ) <EOL> cb . setIcon ( self . _ICON ) <EOL> cb . setImmediate ( True ) <EOL> cb . addListener ( self , IClickListener ) <EOL> self . addComponent ( cb ) <EOL> def buttonClick ( self , event ) : <EOL> enabled = event . getButton ( ) . booleanValue ( ) <EOL> self . getWindow ( ) . showNotification ( '<STR_LIT>' <EOL> + ( '<STR_LIT>' if enabled else '<STR_LIT>' ) ) </s>
