Tk::HexEntryPlain - A hexadecimal entry widget


Tk-HexEntry documentation  | view source Contained in the Tk-HexEntry distribution.

Index


NAME

Top

Tk::HexEntryPlain - A hexadecimal entry widget

SYNOPSIS

Top

    use Tk::HexEntryPlain;

ATTENTION

Top

This is only a changed copy from Tk::NumEntry and Tk::NumEntryPlain write from Graham Barr <gbarr@pobox.com>. Thanks for this great Module!

DESCRIPTION

Top

Tk::HexEntryPlain defines a widget for entering hexadecimal values.

Tk::HexEntryPlain supports all the options and methods that a normal Entry (Tk::Entry) widget provides, plus the following options

STANDARD OPTIONS

Top

-repeatdelay -repeatinterval

WIDGET-SPECIFIC OPTIONS

Top

-minvalue (decimal)

Defines the minimum legal value that the widget can hold. If this value is undef then there is no minimum value (default = undef).

-maxvalue (decimal)

Defines the maximum legal value that the widget can hold. If this value is undef then there is no maximum value (default = undef).

-bell

Specifies a boolean value. If true then a bell will ring if the user attempts to enter an illegal character into the entry widget, and when the user reaches the upper or lower limits when using the up/down buttons for keys (default = true).

-textvariable

Reference to a scalar variable that contains the value currently in the NumEntry. Use the variable only for reading (see "CAVEATS" below).

-value

Specifies the value to be inserted into the entry widget. Similar to the standard -text option, but will perform a range check on the value.

WIDGET METHODS

Top

$numentry->incdec(increment)

Increment the value of the entry widget by the specified increment. If increment is 0, then perform a range check.

CAVEATS

Top

-textvariable

-textvariable should only be used to read out the current value in the NumEntry.

Values set via -textvariable are not valided. Therefore it's possible to insert, e.g., 'abc', into the NumEntry.

EXAMPLE

Top

 use Tk;
 use Tk::HexEntry;

 my $var = '0xff2c';

 my $mw = MainWindow->new; 

 my $en = $mw->HexEntry(
 	-textvariable => \$var,
 	-minvalue => 0xff2a,	# calculate intern with decimal values!
 	-maxvalue => 0xffff,	# calculate intern with decimal values!
 	)->pack;

 $mw->repeat(1000, [\&incvar, \$var]);

 MainLoop();

 sub incvar {
 	my $var = shift;
 	$$var = sprintf('%x', hex($$var) + 1);
 	print $$var, "\n";
 }







SEE ALSO

Top

Tk::NumEntry Tk::Entry (Tk::Entry)

HISTORY

Top

The code was extracted from Tk::NumEntry and slightly modified by Achim Bohnet <ach@mpe.mpg.de>. Tk::NumEntry's author is Graham Barr <gbarr@pobox.com>.

Rewrite to hexadecimal Values: Tk::HexEntry's author is Frank Herrmann <xpix@xpix.de>

COPYRIGHT

Top


Tk-HexEntry documentation  | view source Contained in the Tk-HexEntry distribution.