Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
|
|
@ -0,0 +1,32 @@
|
|||
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();
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue