Anonymous user
GUI component interaction: Difference between revisions
m
→{{header|Elena}}
(Added Rust) |
imported>Arakov |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 896:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import forms;
import extensions;
Line 914:
self
.appendControl
.appendControl
.appendControl
self.Caption := "Rosseta Code";
Line 953:
txtNumber.Caption := number.toString()
}
}▼
}</syntaxhighlight>
Line 3,164 ⟶ 3,106:
// Our application state:
let mut value = "0".to_owned();
eframe::run_simple_native("GUI component interaction", options, move |ctx, _frame| {
Line 3,170 ⟶ 3,112:
ui.horizontal(|ui| {
let name_label = ui.label("Value: ");
ui.text_edit_singleline(&mut value
.labelled_by(name_label.id);
});
ui.horizontal(|ui| {
if ui.button("Increment").clicked() {
value = (v + 1).to_string()
▲ }
}
if ui.button("Random").clicked() {
value = (rand::thread_rng().gen_range(1..=10000)).to_string();
}
});
Line 3,669 ⟶ 3,613:
{{libheader|DOME}}
{{libheader|Wren-polygon}}
<syntaxhighlight lang="
import "input" for Mouse, Keyboard
import "dome" for Window
|