FLTK::Item - Widget designed to be a menu or browser item
This widget is designed to be put into FLTK::Menu and FLTK::Browser widgets and draw plain-text items.
All events are ignored,
thus causing the menu and browser to set/clear the
SELECTED flag on these widgets.
If they are selected they draw in the
otherwise in the
my $style = $item->default_style( );
The default style sets
Changing this will mess up the appearance of both menus and browsers.
All the rest of the style is blank,
and normally it inherits from the current browser or menu,
which should call
set_style() before drawing any items.
$item->default_style( $style );
Set the style.
my $self = $item->new( $label );
Unlike other widgets the constructor does not take any dimensions, since it is assummed the container widget will size this correctly.
my $self = $item->new( $label, $image );
This constructor also sets the
useful for a browser item.
my $self = $item->new( $label, $shortcut, \&callback, $user_data, $flags );
$item->set_style( $style, $menubar );
Modify the parent of the
Item::default_style to this style.
If no style settings have been done to an Item,
it will use the textfont,
and possibly other settings inherited from this style to draw itself.
This is used by menus and browsers to cause all the elements inside them to draw using their settings.
menubar flag causes it to mangle the style so that the buttonbox of
style is used as the box,
and the highlight_color is used as the selection_color.
This is done to replicate the rather inconsistent appearance on Windows of menubars.
$item->set_style( $widget, $menubar );
Use the style of this
Sanko Robinson <firstname.lastname@example.org> - http://sankorobinson.com/
Copyright (C) 2008-2010 by Sanko Robinson <email@example.com>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.