You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libtqt-perl/PerlTQt/tutorials/t7/LCDRange.pm

30 lines
683 B

package LCDRange;
use strict;
use TQt;
use TQt::isa qw(TQt::VBox);
use TQt::slots setValue => ['int'];
use TQt::signals valueChanged => ['int'];
use TQt::attributes qw(slider);
sub NEW {
shift->SUPER::NEW(@_);
my $lcd = TQt::LCDNumber(2, this, "lcd");
my $slider = TQt::Slider(&Horizontal, this, "slider");
slider = $slider;
slider->setRange(0, 99);
slider->setValue(0);
$lcd->connect(slider, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('display(int)'));
this->connect(slider, TQT_SIGNAL('valueChanged(int)'), TQT_SIGNAL('valueChanged(int)'));
}
sub value { slider->value }
sub setValue {
my $value = shift;
slider->setValue($value);
}
1;