RosettaCodeData/Task/GUI-component-interaction/Maple/gui-component-interaction-3...

15 lines
428 B
Plaintext

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;