Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // layout - low level
- push_clip(0, 0, 300, 300);
- // imagine you can define these with header = # Style { ... }
- put_text(header, "Welcome to Allen's Layout Concept", 0, 0);
- body_text = # String {
- This is an example of laying out something out manualy,
- with fixed positions, and no layout engine to help.
- };
- put_text(body, body_text, 0, 40);
- pop_clip();
- // layout - with layout engine
- layout = # Column { x = 0, y = 0, w = 300, h = 300, scroll_vert = true };
- push_clip(layout);
- put_text(header, "Welcome to Allen's Layout Concept", layout);
- body_text = # String {
- This is an example of layout something out manuualy,
- with positions from a layout controller.
- }
- put_text(body, body_text, layout);
- pop_clip();
- // layout - the high level function for declarative style
- page = # Section {
- # Section {
- layout = # Column { x = 0, y = 0, w = 300, h = 300, scroll_vert = true },
- # Section {style = header, # String { Welcome to Allen's Layout Concept } },
- # Section {
- style = body,
- # String {
- This is an example of laying something out declaratively,
- and then passing it to the versatile put_section function.
- }
- }
- }
- };
- put_section(page, 0, 0);
Advertisement
RAW Paste Data
Copied
Add Comment
Please, Sign In to add comment
Advertisement