Compare commits
2 Commits
a592318a6f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b54aaf3c4 | |||
| 17c436d944 |
@@ -4,12 +4,12 @@ My experimental attempt at a rust ui library (also my first ui library).
|
|||||||
|
|
||||||
It's currently designed around using retained data structures (widgets), rather than diffing generated trees from data like xilem or iced. This is an experiment and I'm not sure if it's a good idea or not.
|
It's currently designed around using retained data structures (widgets), rather than diffing generated trees from data like xilem or iced. This is an experiment and I'm not sure if it's a good idea or not.
|
||||||
|
|
||||||
There's a `main.rs` that runs a testing window, so you can just `cargo run` to see it working.
|
Examples are in `examples`, eg. `cargo run --example tabs`.
|
||||||
|
|
||||||
Goals, in general order:
|
Goals, in general order:
|
||||||
1. does what I want it to (text, images, video, animations)
|
1. does what I want it to (text, images, video, animations)
|
||||||
2. very easy to use ignoring ergonomic ref counting
|
2. very easy to use ignoring ergonomic ref counting
|
||||||
3. reasonably fast / efficient (a lot faster than electron, save battery life)
|
3. reasonably fast / efficient (a lot faster than electron, save battery life, try to beat iced and xilem)
|
||||||
|
|
||||||
## dev details
|
## dev details
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,13 @@ widget_trait! {
|
|||||||
|
|
||||||
pub trait HasTasks: Sized + HasState + HasEvents {
|
pub trait HasTasks: Sized + HasState + HasEvents {
|
||||||
fn tasks_mut(&mut self) -> &mut Tasks<Self>;
|
fn tasks_mut(&mut self) -> &mut Tasks<Self>;
|
||||||
|
|
||||||
|
fn spawn_task<F: AsyncFnOnce(TaskCtx<Self>) + 'static + std::marker::Send>(&mut self, task: F)
|
||||||
|
where
|
||||||
|
F::CallOnceFuture: Send,
|
||||||
|
{
|
||||||
|
self.tasks_mut().spawn(task);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait AsyncWidgetEventFn<Rsc: HasEvents, W: ?Sized>:
|
pub trait AsyncWidgetEventFn<Rsc: HasEvents, W: ?Sized>:
|
||||||
|
|||||||
Reference in New Issue
Block a user