Anonymous user
GUI component interaction: Difference between revisions
m
→{{header|Elena}}
imported>Arakov |
|||
(5 intermediate revisions by 4 users not shown) | |||
Line 13:
{{omit from|Lotus 123}}
{{omit from|Maxima}}
{{omit from|Minimal BASIC|It does not handle GUI}}
{{omit from|Nascom BASIC|It does not handle GUI}}
{{omit from|PARI/GP}}
{{omit from|PostScript}}
{{omit from|Retro}}
{{omit from|SQL PL|It does not handle GUI}}
{{omit from|Tiny BASIC|It does not handle GUI}}
{{omit from|Palo Alto Tiny BASIC|It does not handle GUI}}
Almost every application needs to communicate with the user in some way.
Line 332 ⟶ 335:
; a timer.</syntaxhighlight>
=={{header|
==={{header|BaCon}}===
Requires BaCon version 4.0.1 or higher, using GTK3.
<syntaxhighlight lang="bacon">OPTION GUI TRUE
Line 371 ⟶ 375:
WEND</syntaxhighlight>
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
<syntaxhighlight lang="bbcbasic"> INSTALL @lib$+"WINLIB2"
Line 892 ⟶ 896:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import forms;
import extensions;
Line 898 ⟶ 902:
public class MainWindow : SDIDialog
{
}</syntaxhighlight>
=={{header|Euphoria}}==
Line 3,147 ⟶ 3,092:
end</syntaxhighlight>
[[File:GuiComponentRunBasic.png]]
== {{Header|Rust}} ==
{{libheader|egui}}
<syntaxhighlight lang="rust">
use eframe::egui;
use rand::Rng;
fn main() -> Result<(), eframe::Error> {
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(214.0, 100.0)),
..Default::default()
};
// Our application state:
let mut value = "0".to_owned();
eframe::run_simple_native("GUI component interaction", options, move |ctx, _frame| {
egui::CentralPanel::default().show(ctx, |ui| {
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() {
if let Ok(v) = value.parse::<usize>() {
value = (v + 1).to_string()
}
}
if ui.button("Random").clicked() {
value = (rand::thread_rng().gen_range(1..=10000)).to_string();
}
});
});
})
}</syntaxhighlight>
[[File:Rust GUI component interaction.png|none|thumb]]
=={{header|Scala}}==
Line 3,631 ⟶ 3,613:
{{libheader|DOME}}
{{libheader|Wren-polygon}}
<syntaxhighlight lang="
import "input" for Mouse, Keyboard
import "dome" for Window
|