June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -1,10 +1,10 @@
{{omit from|ACL2}}
{{omit from|Applesoft BASIC|no concept of a GUI}}
{{omit from|Commodore BASIC}}
{{omit from|AWK|no concept of a GUI}}
{{omit from|Batch File}}
{{omit from|Blast}}
{{omit from|Brainf***}}
{{omit from|Commodore BASIC}}
{{omit from|GUISS|Only makes use of installed applications}}
{{omit from|Integer BASIC|no concept of a GUI}}
{{omit from|Lilypond}}
@ -14,6 +14,8 @@
{{omit from|PARI/GP}}
{{omit from|PostScript}}
{{omit from|Retro}}
{{omit from|SQL PL|It does not handle GUI}}
Almost every application needs to communicate with the user in some way.
Therefore, a substantial part of the code deals with the interaction

View file

@ -0,0 +1 @@
Increase();

View file

@ -0,0 +1 @@
Random();

View file

@ -0,0 +1,14 @@
macro(SP=DocumentTools:-SetProperty, GP=DocumentTools:-GetProperty);
with(Maplets[Elements]):
SP("Text",value,0);
Increase:=proc()
SP("Text",value,parse(GP("Text",value))+1);
end proc;
Random:=proc()
maplet := Maplet(["Are you sure?", [Button("OK", Shutdown("true")), Button("Cancel", Shutdown())]]);
result := Maplets[Display](maplet);
if result = "true" then
j:=rand(1..1000);
SP("Text",value,j());
end if;
end proc;

View file

@ -1,8 +1,9 @@
use GTK::Simple;
use GTK::Simple::App;
my GTK::Simple::App $app .= new(title => 'GUI component interaction');
$app.set_content(
$app.set-content(
my $box = GTK::Simple::VBox.new(
my $value = GTK::Simple::Entry.new(text => '0'),
my $increment = GTK::Simple::Button.new(label => 'Increment'),
@ -10,8 +11,8 @@ $app.set_content(
)
);
$app.size_request(400, 100);
$app.border_width = 20;
$app.size-request(400, 100);
$app.border-width = 20;
$box.spacing = 10;
$value.changed.tap: {
@ -19,14 +20,14 @@ $value.changed.tap: {
}
$increment.clicked.tap: {
$value.text += 1;
my $val = $value.text; $val += 1; $value.text = $val.Str
}
$random.clicked.tap: {
# Dirty hack to work around the fact that GTK::Simple doesn't provide
# access to GTK message dialogs yet :P
if run «zenity --question --text "Reset to random value?"» {
$value.text = (^100).pick;
$value.text = (^100).pick.Str
}
}