FLTK::PopupMenu - Group that packs all it's child widgets against the edges
This subclass pops up a menu in response to a user click.
The menu is popped up positioned so that the mouse is pointing at the last-selected item,
even if it in a nested submenu (To turn off this behaivor do
value(-1) after each item is selected).
Normally, any mouse button will pop up a menu and it is lined up above the button, or below it when there is no previous selected value as shown in the picture.
However a PopupMenu can also have
type( ) set to
It then becomes invisible and ignores all mouse buttons other than the ones named in the popup type.
You can then resize it to cover another widget (or many widgets) so that pressing that button pops up the menu.
Typing the shortcut of any menu items will cause it to be picked. The callback will be done but there will be no visible effect to the widget.
my $mnu = $popupmenu->new( $x, $y, $w, $h, $label );
Creates a new PopupMenu.
my $value = $popupmenu->popup( );
Wrapper for "Menu::popup( )"|FLTK::Menu/"popup">.
The little down-arrow indicator can be replaced by setting a new
glyph( ) function and making it draw whatever you want.
If you don't want any glyph at all it is probably easiest to subclass and replace
draw( ) with your own function.
Sanko Robinson <email@example.com> - http://sankorobinson.com/
Copyright (C) 2008-2010 by Sanko Robinson <firstname.lastname@example.org>
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.