example2.e 917 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. class EXAMPLE2
  2. insert
  3. IUP_INTERFACE
  4. create {ANY}
  5. make
  6. feature {ANY}
  7. make
  8. local
  9. gui: IUP
  10. i: STRING
  11. a: ARRAY[IUP_WIDGET]
  12. l: IUP_LABEL
  13. lk: IUP_LINK
  14. b: IUP_BUTTON
  15. h: IUP_HBOX
  16. w: IUP_DIALOG
  17. do
  18. gui := iup_open
  19. create l.label("Hello world from Liberty Eiffel!")
  20. l.set_expand("YES")
  21. create lk.link("www.liberty-eiffel.org", "Visit the website")
  22. lk.set_expand("YES")
  23. create b.button("OK")
  24. b.set_cb_action(agent close(?))
  25. b.set_maxsize(70, 30)
  26. b.set_expand("YES")
  27. a := {ARRAY[IUP_WIDGET] 1, << l, lk, b >>}
  28. create h.hbox(a)
  29. h.set_alignment("ACENTER")
  30. h.set_gap(10)
  31. h.set_margin(10, 10)
  32. create w.dialog(h)
  33. w.set_title("Hello world")
  34. i := w.show
  35. gui.main_loop
  36. gui.close
  37. end
  38. close (widget: IUP_WIDGET): STRING
  39. do
  40. Result := "IUP_CLOSE"
  41. end
  42. end -- class EXAMPLE2