Skip to content

Commit

Permalink
Merge branch 'main' into feature/world-coords
Browse files Browse the repository at this point in the history
  • Loading branch information
ecton committed Nov 16, 2023
2 parents fa56922 + 1ed1a95 commit a8841e6
Show file tree
Hide file tree
Showing 56 changed files with 3,290 additions and 999 deletions.
26 changes: 15 additions & 11 deletions .crate-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,28 @@ reactive data models work, consider this example that displays a button that
increments its own label:

```rust,ignore
// Create a dynamic usize.
let count = Dynamic::new(0_usize);
// Create a new button with a label that is produced by mapping the contents
// of `count`.
Button::new(count.map_each(ToString::to_string))
// Set the `on_click` callback to a closure that increments the counter.
.on_click(count.with_clone(|count| move |_| count.set(count.get() + 1)))
// Run the button as an an application.
.run()
fn main() -> gooey::Result {
// Create a dynamic usize.
let count = Dynamic::new(0_isize);
// Create a dynamic that contains `count.to_string()`
let count_label = count.map_each(ToString::to_string);
// Create a new button whose text is our dynamic string.
count_label
.into_button()
// Set the `on_click` callback to a closure that increments the counter.
.on_click(count.with_clone(|count| move |_| count.set(count.get() + 1)))
// Run the application
.run()
}
```

[widget]: crate::widget::Widget
[kludgine]: https://github.com/khonsulabs/kludgine
[wgpu]: https://github.com/gfx-rs/wgpu
[winit]: https://github.com/rust-windowing/winit
[widgets]: mod@crate::widgets
[button-example]: https://github.com/khonsulabs/gooey/tree/main/examples/button.rs
[button-example]: https://github.com/khonsulabs/gooey/tree/main/examples/basic-button.rs

## Open-source Licenses

Expand Down
4 changes: 2 additions & 2 deletions .rustme/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ reactive data models work, consider this example that displays a button that
increments its own label:

```rust,ignore
$../examples/button.rs:readme$
$../examples/basic-button.rs:readme$
```

[widget]: $widget$
[kludgine]: https://github.com/khonsulabs/kludgine
[wgpu]: https://github.com/gfx-rs/wgpu
[winit]: https://github.com/rust-windowing/winit
[widgets]: $widgets$
[button-example]: https://github.com/khonsulabs/gooey/tree/$ref-name$/examples/button.rs
[button-example]: https://github.com/khonsulabs/gooey/tree/$ref-name$/examples/basic-button.rs
Loading

0 comments on commit a8841e6

Please sign in to comment.