Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/User-input-Graphical/Raku/user-input-graphical.raku
Normal file
27
Task/User-input-Graphical/Raku/user-input-graphical.raku
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
use GTK::Simple;
|
||||
use GTK::Simple::App;
|
||||
|
||||
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