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.
50 lines
917 B
50 lines
917 B
13 years ago
|
#!/usr/bin/perl -w
|
||
|
use strict;
|
||
|
use blib;
|
||
|
|
||
|
package LCDRange;
|
||
13 years ago
|
use TQt;
|
||
|
use TQt::isa qw(TQt::VBox);
|
||
13 years ago
|
|
||
|
sub NEW {
|
||
|
shift->SUPER::NEW(@_);
|
||
|
|
||
13 years ago
|
my $lcd = TQt::LCDNumber(2, this, "lcd");
|
||
|
my $slider = TQt::Slider(&Horizontal, this, "slider");
|
||
13 years ago
|
$slider->setRange(0, 99);
|
||
|
$slider->setValue(0);
|
||
13 years ago
|
$lcd->connect($slider, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('display(int)'));
|
||
13 years ago
|
}
|
||
|
|
||
|
package MyWidget;
|
||
13 years ago
|
use TQt;
|
||
|
use TQt::isa qw(TQt::VBox);
|
||
13 years ago
|
use LCDRange;
|
||
|
|
||
|
sub NEW {
|
||
|
shift->SUPER::NEW(@_);
|
||
|
|
||
13 years ago
|
my $quit = TQt::PushButton("Quit", this, "quit");
|
||
|
$quit->setFont(TQt::Font("Times", 18, &TQt::Font::Bold));
|
||
13 years ago
|
|
||
13 years ago
|
TQt::app->connect($quit, TQT_SIGNAL('clicked()'), TQT_SLOT('quit()'));
|
||
13 years ago
|
|
||
13 years ago
|
my $grid = TQt::Grid(4, this);
|
||
13 years ago
|
|
||
|
for(0..3) {
|
||
|
for(0..3) {
|
||
|
LCDRange($grid);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
package main;
|
||
|
use MyWidget;
|
||
|
|
||
13 years ago
|
my $a = TQt::Application(\@ARGV);
|
||
13 years ago
|
|
||
|
my $w = MyWidget;
|
||
|
$a->setMainWidget($w);
|
||
|
$w->show;
|
||
|
exit $a->exec;
|