User input/Graphical: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: Added Perl 6 implementation)
Line 786: Line 786:
},
},
);</lang>
);</lang>

=={{header|Perl 6}}==
{{libheader|GTK}}
<lang perl6>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;</lang>


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==