1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- class EXAMPLE1
- inherit
- IUP_INTERFACE
- create
- make
- feature
- make
- local
- gui: IUP
- i: STRING
- a: ARRAY[IUP_WIDGET]
- l: IUP_LABEL
- b: IUP_BUTTON
- f: IUP_FLAT_BUTTON
- v: IUP_VBOX
- w: IUP_DIALOG
- do
- gui := iup_open
-
- create l.label("Hello world from Eiffel-IUP!")
-
- create b.button("OK")
- b.set_cb_action(agent close)
- b.set_rgb_background_color(0, 200, 0) -- This not work on Gtk3, use IUP_FLAT_BUTTON as show below.
- create f.flat_button("A flat button")
- f.set_cb_flat_action(agent flat_close)
- f.set_rgb_background_color(0, 200, 0)
- f.set_padding(5, 3)
- f.set_border(True)
- a := {ARRAY[IUP_WIDGET]} << l, b, f >>
- create v.vbox(a)
- v.set_alignment("ACENTER")
- v.set_gap(10)
- v.set_margin(10, 10)
-
- create w.dialog(v)
- w.set_title("Hello world")
- i := w.show
- gui.main_loop
- gui.close
- end
- close (widget: IUP_BUTTON): STRING
- do
- io.put_string("Executed %N")
- Result := "IUP_CLOSE"
- end
- flat_close (widget: IUP_FLAT_BUTTON): STRING
- do
- io.put_string("Executed %N")
- Result := "IUP_CLOSE"
- end
- end -- class EXAMPLE1
|