-
Notifications
You must be signed in to change notification settings - Fork 193
/
minimal.rs
44 lines (42 loc) · 1.2 KB
/
minimal.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ANCHOR: All
// ANCHOR: Use
use orbtk::prelude::*;
// ANCHOR_END: Use
// ANCHOR: Main
fn main() {
// ANCHOR_END: Main
// ANCHOR: Initialize
// use this only if you want to run it as web application.
orbtk::initialize();
// ANCHOR_END: Initialize
// ANCHOR: Application
Application::new()
// ANCHOR_END: Application
// ANCHOR: Window
.window(|ctx| {
Window::new()
.title("OrbTk - Minimal")
.position((100.0, 100.0))
.size(420.0, 140.0)
// ANCHOR_END: Window
// ANCHOR: Child
.child(
TextBlock::new()
// ANCHOR: Properties
.font_size(28)
.h_align("center")
.text("Hey OrbTk!")
.v_align("center")
// ANCHOR_END: Properties
.build(ctx),
)
// ANCHOR: Build
.build(ctx)
// ANCHOR_END: Build
// ANCHOR_END: Child
})
// ANCHOR: Run
.run();
// ANCHOR_END: Run
}
// ANCHOR_END: All