20 Nov 2021 15:34:17 UTC
- Distribution: Tickit-Widget-SegmentDisplay
- Module version: 0.08
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (20 / 1 / 36)
- KwaliteeBus factor: 1
- % Coverage
- License: perl_5
- Perl: v5.26.0
- Download (17.41KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Tickit::Widget::SegmentDisplay- show a single character like a segmented display
This class provides a widget that imitates a segmented LED or LCD display. It shows a single character by lighting or shading fixed rectangular bars.
The default style pen is used as the widget pen, though only the background colour will actually matter as the widget does not directly display text.
The following style keys are used:
- lit => COLOUR
- unlit => COLOUR
Colour descriptions (index or name) for the lit and unlight segments of the display.
$segmentdisplay = Tickit::Widget::SegmentDisplay->new( %args )
Constructs a new
Takes the following named arguments
- value => STR
Sets an initial value.
- type => STR
The type of display. Supported types are:
A 7-segment bar display. The display can also be blanked with the value " ".
A 7-segment bar display with decimal-point. To light the decimal point, append the value with ".".
A unit, prefix symbol or other character. The following characters are recognised:
V A W Ω F H s G M k m µ n p + - %
Each will be drawn in a style approximately to fit the general LED shape display, by drawing lines of erased cells. Note however that some more intricate shapes may not be very visible on smaller scales.
- use_unicode => BOOL
If true, use Unicode block-drawing characters. If false, use only coloured erase cells using the background colour.
- use_halfline => BOOL
If true, vertical resolution of rendered block characters is effectively doubled by using half-filled Unicode block-drawing characters. Setting this option implies
- use_linedraw => BOOL
If true, use Unicode linedrawing instead of erased or solid blocks. This style is more readable on smaller sizes, but is only supported by
- thickness => INT
Gives the number of columns wide and half-lines tall that LED bars will be drawn in. Note that unless
use_halflineis set, this value ought to be an even number. Defaults to 2.
use_linedrawis in effect, if
thicknessis greater than 1 then
LINE_THICKsegments will be used for drawing. Defaults to 1.
$value = $segmentdisplay->value $segmentdisplay->set_value( $value )
Return or set the character on display
Paul Evans <firstname.lastname@example.org>
Module Install Instructions
To install Tickit::Widget::SegmentDisplay, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Tickit::Widget::SegmentDisplay
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|