hello_world_5.e 958 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. class HELLO_WORLD_5
  2. insert
  3. IUP_INTERFACE
  4. create {ANY}
  5. make
  6. feature {ANY}
  7. make
  8. local
  9. s: STRING
  10. gui: IUP
  11. dlg: IUP_DIALOG
  12. l: IUP_LABEL
  13. btn: IUP_BUTTON
  14. vb: IUP_VBOX
  15. do
  16. gui := iup_open
  17. create l.label("Hello world from IUP.")
  18. --l.set_alignment("ACENTER", "ACENTER")
  19. l.set_expand("HORIZONTAL")
  20. create btn.button("OK")
  21. btn.set_cb_action(agent click_btn(?))
  22. --btn.set_expand("HORIZONTAL")
  23. create vb.vbox({ARRAY[IUP_WIDGET] 1, << l, btn >>})
  24. vb.set_alignment("ACENTER")
  25. vb.set_gap(10)
  26. vb.set_margin(10, 10)
  27. --vb.set_expand_children(True)
  28. create dlg.dialog(vb)
  29. dlg.set_title("Hello World 5")
  30. s := dlg.show_predefined_xy("IUP_CENTER", "IUP_CENTER")
  31. gui.main_loop
  32. gui.close
  33. end
  34. click_btn (button: IUP_BUTTON): STRING
  35. local
  36. ms: IUP_MESSAGE
  37. do
  38. create ms.message("Hello World Message", "Hello world from IUP.")
  39. Result := "IUP_CLOSE"
  40. end
  41. end