test47.nim 881 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # --- Test 47. Use margin. --- #
  2. import nodesnim
  3. Window("Margin test")
  4. build:
  5. - Scene main:
  6. - HBox box1:
  7. call setBackgroundColor(Color("#55c"))
  8. call setPadding(8, 8, 8, 8)
  9. call move(64, 64)
  10. separator: 0
  11. - ColorRect rect1:
  12. color: Color("#ee5")
  13. call setMargin(0, 16, 0, 0)
  14. - ColorRect rect2:
  15. color: Color("#5ee")
  16. call setMargin(8, 0, 32, 0)
  17. - ColorRect rect3:
  18. color: Color("#e5e")
  19. - VBox box2:
  20. call setBackgroundColor(Color("#55c"))
  21. call setPadding(8, 8, 8, 8)
  22. call move(256, 64)
  23. separator: 0
  24. - ColorRect rect4:
  25. color: Color("#ee5")
  26. call setMargin(16, 0, 0, 0)
  27. - ColorRect rect5:
  28. color: Color("#5ee")
  29. call setMargin(0, 8, 0, 32)
  30. - ColorRect rect6:
  31. color: Color("#e5e")
  32. addMainScene(main)
  33. windowLaunch()