Advertisement
Guest User

Allen's Layout Concept

a guest
Sep 17th, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1.  
  2. // layout - low level
  3.  
  4. push_clip(0, 0, 300, 300);
  5.  
  6. // imagine you can define these with header = # Style { ... }
  7. put_text(header, "Welcome to Allen's Layout Concept", 0, 0);
  8. body_text = # String {
  9. This is an example of laying out something out manualy,
  10. with fixed positions, and no layout engine to help.
  11. };
  12. put_text(body, body_text, 0, 40);
  13.  
  14. pop_clip();
  15.  
  16.  
  17. // layout - with layout engine
  18.  
  19. layout = # Column { x = 0, y = 0, w = 300, h = 300, scroll_vert = true };
  20.  
  21. push_clip(layout);
  22.  
  23. put_text(header, "Welcome to Allen's Layout Concept", layout);
  24. body_text = # String {
  25. This is an example of layout something out manuualy,
  26. with positions from a layout controller.
  27. }
  28. put_text(body, body_text, layout);
  29.  
  30. pop_clip();
  31.  
  32.  
  33. // layout - the high level function for declarative style
  34.  
  35. page = # Section {
  36. # Section {
  37. layout = # Column { x = 0, y = 0, w = 300, h = 300, scroll_vert = true },
  38. # Section {style = header, # String { Welcome to Allen's Layout Concept } },
  39. # Section {
  40. style = body,
  41. # String {
  42. This is an example of laying something out declaratively,
  43. and then passing it to the versatile put_section function.
  44. }
  45. }
  46. }
  47. };
  48.  
  49. put_section(page, 0, 0);
Advertisement
RAW Paste Data Copied
Add Comment
Please, Sign In to add comment
Advertisement