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/J/user-input-graphical-1.j
Normal file
26
Task/User-input-Graphical/J/user-input-graphical-1.j
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
SIMPLEGUI=: noun define
|
||||
pc simpleGui;
|
||||
cc IntegerLabel static;cn "Enter the integer 75000";
|
||||
cc integer edit;
|
||||
cc TextLabel static;cn "Enter text";
|
||||
cc text edit;
|
||||
cc accept button;cn "Accept";
|
||||
pshow;
|
||||
)
|
||||
|
||||
simpleGui_run=: wd bind SIMPLEGUI
|
||||
simpleGui_close=: wd bind 'pclose'
|
||||
simpleGui_cancel=: simpleGui_close
|
||||
|
||||
simpleGui_accept_button=: verb define
|
||||
ttxt=. text
|
||||
tint=. _". integer
|
||||
if. tint ~: 75000 do.
|
||||
wdinfo 'Integer entered was not 75000.'
|
||||
else.
|
||||
simpleGui_close ''
|
||||
'simpleGui_text simpleGui_integer'=: ttxt;tint
|
||||
end.
|
||||
)
|
||||
|
||||
simpleGui_run''
|
||||
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;
|
||||
|
|
@ -2,11 +2,11 @@ import swing.Dialog.{Message, showInput}
|
|||
import scala.swing.Swing
|
||||
|
||||
object UserInput extends App {
|
||||
val s = showInput(null,
|
||||
def responce = showInput(null,
|
||||
"Complete the sentence:\n\"Green eggs and...\"",
|
||||
"Customized Dialog",
|
||||
Message.Plain,
|
||||
Swing.EmptyIcon,
|
||||
Nil, "ham")
|
||||
println(s)
|
||||
println(responce)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue