The main procedure in an ohugs program is executed
if its type is (a subtype of ) env -> Cmd (),
where env is one of the supported computing environment
types.
Presently, the following environments are supported:
The standard environment type StdEnv
provides methods
for text-based event-driven programming using stdin and
stdout, file access and network programming. In addition,
StdEnv provides convenience methods for accessing command
line arguments, environment variables and system time.
TkEnv < StdEnv adds methods for GUI programming with
a rich collection of widgets like buttons, selection lists, menus,
sliders etc. This environment requires that Tcl/Tk is available
on your system and that ohugs is installed with
the O_TK flag set. Note that, because of contravariance,
StdEnv -> Cmd() < TkEnv -> Cmd(). If the type of
main is a subtype of TkEnv -> Cmd(), but
not a subtype of StdEnv -> Cmd(), a Tk interpreter is
started by the runtime system and communication between
ohugs and the Tk interpreter is set up.
While StdEnv is defined in the standard Prelude,
TkEnv requires that the module Tk is imported.
TixEnv < StdEnv adds further widgets. This environment
requires that the Tix toolkit is available and that ohugs
was installed with the O_TIX flag set. In a similar way as
with TkEnv, use of TixEnv requires import of
module
Tix and causes a Tix interpreter to be started.
Page maintained by
Björn von Sydow Last modification January 25, 2001.