FLTK::FloatInput - Subclass of FLTK::NumericInput
A subclass of NumericInput that only allows the user to type floating point numbers (sign, digits, decimal point, more digits, 'E' or 'e', sign, digits), or hex constants that start with "0x". This is done by overriding the replace() method. Besides editing the text the user can use the up/down arrow keys to change the digits.
You may want a ValueInput widget instead. It has up/down buttons (what is called a "Spinner" in some toolkits).
If you change when() to WHEN_ENTER_KEY, the callback is only done when the user hits the up/down arrow keys or when the user types the Enter key. This may be more useful than the default setting of WHEN_CHANGED which can make the callback happen when partially-edited numbers are in the field.
when()
WHEN_ENTER_KEY
WHEN_CHANGED
The type() can either be either FLTK::FloatInput::FLOAT or FLTK::FloatInput::INT. Setting it to INT makes this act like the IntInput subclass.
type()
FLTK::FloatInput::FLOAT
FLTK::FloatInput::INT
INT
fvalue()
my $float = $floatinput->fvalue()( );
Convert the string to a double using strtod().
strtod()
ivalue
my $int = $floatinput->ivalue( );
Convert the string to an integer, using int(strtol()).
int(strtol())
lvalue()
my $long = $floatinput->lvalue()( );
Convert the string to a long using strtol().
strtol()
new
my $input = $floatinput->new( $x, $y, $w, $h, $label );
Creates a new FLTK::FloatInput object.
FLTK::FloatInput
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.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.
To install FLTK, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FLTK
CPAN shell
perl -MCPAN -e shell install FLTK
For more information on module installation, please visit the detailed CPAN module installation guide.