Skip to content

Commit 6846252

Browse files
committed
examples: fix starting at 0 when we should start at 1
Closes #75
1 parent 9304c8f commit 6846252

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ No deprecations.
3434

3535
* `VerticalBox` and `HorizontalBox` no longer link to the removed `BoxExt` trait.
3636
* `ui-sys` now builds on modern macOS.
37+
* `inputs` and `inputs-grid` examples no longer erroneously start at 0 for inputs starting at 1.
3738

3839
### Security
3940

iui/examples/inputs-grid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() {
2222
let ui = UI::init().unwrap();
2323

2424
// Initialize the state of the application.
25-
let state = Rc::new(RefCell::new(State { slider_val: 0, spinner_val: 0, entry_val: "".into(), password_val: "".into(), multi_val: "".into() }));
25+
let state = Rc::new(RefCell::new(State { slider_val: 1, spinner_val: 1, entry_val: "".into(), password_val: "".into(), multi_val: "".into() }));
2626

2727
// Create the grid which we'll use to lay out controls
2828
let mut grid = LayoutGrid::new(&ui);

iui/examples/inputs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() {
2020
let ui = UI::init().unwrap();
2121

2222
// Initialize the state of the application.
23-
let state = Rc::new(RefCell::new(State { slider_val: 0, spinner_val: 0, entry_val: "".into(), password_val: "".into(), multi_val: "".into() }));
23+
let state = Rc::new(RefCell::new(State { slider_val: 1, spinner_val: 1, entry_val: "".into(), password_val: "".into(), multi_val: "".into() }));
2424

2525
// Set up the inputs for the application.
2626
// While it's not necessary to create a block for this, it makes the code a lot easier

0 commit comments

Comments
 (0)