Sanko Robinson > FLTK-0.532009 > FLTK::FloatInput



Annotate this POD


View/Report Bugs
Module Version: 0.532006   Source  


FLTK::FloatInput - Subclass of FLTK::NumericInput

Description ^

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.

The type() can either be either FLTK::FloatInput::FLOAT or FLTK::FloatInput::INT. Setting it to INT makes this act like the IntInput subclass.

Functions ^


my $float = $floatinput->fvalue()( );

Convert the string to a double using strtod().


my $int = $floatinput->ivalue( );

Convert the string to an integer, using int(strtol()).


my $long = $floatinput->lvalue()( );

Convert the string to a long using strtol().


my $input = $floatinput->new( $x, $y, $w, $h, $label );

Creates a new FLTK::FloatInput object.

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: