Sanko Robinson > FLTK-0.532009 > FLTK::CycleButton



Annotate this POD


View/Report Bugs
Module Version: 0.532006   Source  


FLTK::CycleButton - Popup list of items that the user can choose one of

Description ^

This widget lets the user select one of a set of choices by clicking on it. Each click cycles to the next choice. Holding down any shift key or using the middle or right mouse button cycles backwards.

Notice that the number of items can be 2. In this case this widget serves the common purpose of a "toggle" button that shows the current on/off state by changing it's label.

This is a subclass of Menu. The possible states are defined by using Menu::add() or other methods that define the menu items. You can also put a different callback on each item. Or you can replace this widget's callback with your own and use value() to get the index of the current setting. Items that are not visible() or are not active() are skipped by the cycling.

If you set buttonbox() to NO_BOX then you must define your items to draw identical-sized and fully opaque images, so that drawing one completely obscures any other one. This was done to avoid blinking when drawing "artistic" user interfaces where all the entire button is an image.

Functions ^


my $self = $cyclebutton->new( $x, $y, $w, $h, $label );

Creates a new FLTK::CycleButton object. Obviously.

Author ^

Sanko Robinson <> -

License and Legal ^

Copyright (C) 2008-2010 by Sanko Robinson <>

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.

syntax highlighting: