TAG TECHNOLOGY
This commit is contained in:
@@ -12,9 +12,13 @@ pub fn main() {
|
||||
App::run();
|
||||
}
|
||||
|
||||
struct Data {
|
||||
x: u32,
|
||||
}
|
||||
|
||||
pub struct Client {
|
||||
renderer: Renderer,
|
||||
ui: Ui,
|
||||
ui: Ui<Data>,
|
||||
test: WidgetId<Span>,
|
||||
}
|
||||
|
||||
@@ -32,7 +36,8 @@ impl Client {
|
||||
ui.set_base(
|
||||
(
|
||||
(
|
||||
rect.color(UiColor::BLUE),
|
||||
rect.color(UiColor::BLUE)
|
||||
.sense(|d: &mut Data| println!("{}", d.x)),
|
||||
(
|
||||
rect.color(UiColor::RED).center((100.0, 100.0)),
|
||||
(
|
||||
@@ -77,7 +82,8 @@ impl Client {
|
||||
match event {
|
||||
WindowEvent::CloseRequested => event_loop.exit(),
|
||||
WindowEvent::RedrawRequested => {
|
||||
self.renderer.update(&mut self.ui);
|
||||
let primitives = self.ui.update(&mut Data { x: 39 });
|
||||
self.renderer.update(primitives);
|
||||
self.renderer.draw()
|
||||
}
|
||||
WindowEvent::Resized(size) => self.renderer.resize(&size),
|
||||
|
||||
Reference in New Issue
Block a user