Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
26
Task/User-input-Graphical/Perl-6/user-input-graphical.pl6
Normal file
26
Task/User-input-Graphical/Perl-6/user-input-graphical.pl6
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
use GTK::Simple;
|
||||
|
||||
my GTK::Simple::App $app .= new( title => 'User Interaction' );
|
||||
|
||||
$app.border_width = 20;
|
||||
|
||||
$app.set_content(
|
||||
GTK::Simple::VBox.new(
|
||||
my $ = GTK::Simple::Label.new( text => 'Enter a string.' ),
|
||||
my $str = GTK::Simple::Entry.new,
|
||||
my $string = GTK::Simple::Label.new,
|
||||
my $ = GTK::Simple::Label.new( text => 'Enter the number 75000' ),
|
||||
my $val = GTK::Simple::Entry.new,
|
||||
my $correct = GTK::Simple::Label.new,
|
||||
)
|
||||
);
|
||||
|
||||
$str.changed.tap: {
|
||||
$string.text = "You entered: { $str.text }"
|
||||
}
|
||||
|
||||
$val.changed.tap: {
|
||||
$correct.text = "That's { 'not' unless $val.text ~~ / ^^ <ws> 75000 <ws> $$ / } 75000!"
|
||||
}
|
||||
|
||||
$app.run;
|
||||
Loading…
Add table
Add a link
Reference in a new issue