NAME
Tk::LCD - display Liquid Crystal Display symbols.
SYNOPSIS
use Tk::LCD;
$lcd = $parent->LCD(-opt => val, ... );
DESCRIPTION
Tk::LCD is a Canvas derived widget, based on a code snippet from Donal K. Fellows' Maze game. LCD symbols are displayed in elements composed of 8 segments, labeled "a" though "g", some on and some off. For instance, the number 8 requires one LCD element that has all 8 segments lit:
b
-
a | | c
- <------ g
f | | d
_
e
A Tk::LCD widget can consist of any number of elements, specified during widget creation. To actually display an LCD number, either invoke the set() method, or use the -variable option.
LCD elements can display a space, minus sign or a numerical diget, meaning that any positive or negative integer number can be displayed.
LCD elements can also be either large or small in size. If an LCD widget's size is small, then there is room enough between elements to display dots and commas. As a result, any positive or negative decimal number can be displayed. Additionally, numbers are automatically "commified", that is, commas are inserted every third digit to the left of the decimal point.
OPTIONS
The following option/value pairs are supported:
- -elements
-
The number of LCD elements (digits). Default is 5.
- -onoutline
-
Outline color for ON segments.
- -onfill
-
Fill color for ON segments.
- -offoutline
-
Outline color for OFF segments.
- -offfill
-
Fill color for OFF segments.
- -size
-
Size of LCD elements, either large or small (default is large).
- -variable
-
A scalar reference that contains the LCD number to display. The widget is updated when this variable changes value.
METHODS
$lcd->set($number);
Display $number in the LCD widget.
ADVERTISED WIDGETS
Component subwidgets can be accessed via the Subwidget method. This mega widget has no advertised subwidgets.
EXAMPLE
$lcd = $mw->LCD(-variable => \$frog)->pack;
$lcd->set(4000);
$frog = 2001;
AUTHOR
sol0@Lehigh.EDU
Copyright (C) 2001 - 2003, Steve Lidie. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
KEYWORDS
LCD, Canvas