The Hello World program with a Quit button
This program just opens a small window displaying
the message "Hello, world!" and a Quit button.
The window will look something like this (depending on your setup):
Here is the source code:
main = fudlogue (shellF "Hello" (labelF "Hello, world!" >+< quitButtonF))
Things to note
- This program is a small extension of
the previous one.
We have replaced
(labelF "Hello, world!")
(labelF "Hello, world!" >+< quitButtonF)
is parallel composition
of fudgets (see the circuit diagram in the
- The fudget quitButtonF
is a button which quits the program when pressed.
- The automatic layout system chose to use a horizontal
composition of the two parts in this user interface.
- The window manager usually provides a quit button in the window frame
or something equivalent, so there is usually no need to put an
extra quit button in the program.