Announce: FranTk

FranTk (pronounced "frantic") is a declarative library for building
GUIs in Haskell. It's designed to allow you to build your application
in a declarative manner. It uses behaviours and events, concepts from 
Conal Elliot's Functional Reactive Animation. These allow you to model a
system over time. Events are used to describe values that occur
discretely, such as button clicks. Behaviors are continuous quantities
that vary over time. They are used to represent the state of an
application. Events and behaviors can interact. For instance, we can
have a behavior that changes on every event. You can then render this
application on to an interface. 

FranTk provides a full range of widgets for building user interfaces,
including strong support for building interfaces with dynamically
changing numbers of widgets.

FranTk works under hugs98 and ghc-5. It uses a number of the
extensions provided by these systems, such as multi-parameter type
classes, universal and existentially qualified types and weak
pointers.

FranTk currently lives on top of Tcl-Tk (working via TclHaskell). 
It provides a platform independent way to develop GUIs. Tcl-Tk runs on
windows, macs and unix without altering source code, and provides
native look and feel. FranTk has been developed with Tcl8.3. (It
will work with versions of Tcl/Tk from version 8.0 onwards).
You'll need tcl-tk 8.x. Get it from
http://www.scriptics.com/

There is a user manual, and demos directory, with a full range of 
examples.

Send bug reports to: Meurig Sage, meurig@dcs.gla.ac.uk
The FranTk web site is at:
http://haskell.org/FranTk/

Running this release:

For ghc compile up with the make files in the src directory. You need
to compile the modules in TclHaskellSrc, then FranSrc, then FranTkSrc.
Then compile up the demos directory. You will get two binary files, 
demos (from Demos.lhs) and talkdemos (TalkDemos.lhs). 

To run the compiled program run
./demo

The tclexe script sets two environment variables for tcl-tk that set
the environment variables to find the Tcl and Tk libraries. You'll
need to set the environment variables in the script.

For hugs if using window95/NT, run with the tclhugs98.bat program. 
This sets the necessary environment variables.
There is a dll for the C primitives that allow access to Tcl-Tk.

If on unix compile up the TclPrim.so library and run the tclexe
script, with hugs as the argument program.

You'll need to set the hugs search path to include all the src 
directories. Assuming $FRANTK point to the FranTk installation
that would be:

tclexe hugs -98 -P{Hugs}/lib:{Hugs}/lib/hugs:{Hugs}/lib/exts:$FranTk/src/TclHaskellSrc:$FranTk/src/FranTkSrc:$FranTk/src/FRPSrc:$FranTk/src/FRPSrc/BehaviorTypes:$FranTk/src/FRPSrc/FranCore:$FranTk/src/FRPSrc/FRPImpl:$FranTk/src/FRPSrc/StaticTypes

You need to run hugs in -98 mode as FranTk uses a number of 
extensions.
Type :s +o to allow overlapping instances.

If you experience strange behavior under hugs, try restarting hugs. 
There may be something funny going on with cached weak pointers
and finalisers, when modules are changed, and code is then rerun.

IMPORTANT BUGS

There is one serious and important bug. With Tcl there appears to
be no way to get a system independent time value with a greater
accuracy than every second. This is ok most of the time. However,
it makes the bouncing ball example, which assumes time, values change
every half second, look extremely juttery. There is a system dependent
solution.
There are several versions of module TclTime in TclHaskellSrc.
These are TclTime.independent.hs TclTime.NT.hs TclTime.linux.hs
The independent version gives time units changing every second. This
is the version that is used as TclTime.hs initially.
The explicit NT and linux version use the system depedent 
"clock clicks" tcl function. Initial testing suggests that this gives
values in units of millisecond under NT and microseconds under linux.
If you want something this accurate use the system dependent versions
but you'd better test on your system first.

Here's what the tcl user manual has to say on the subject of clock clicks

clock clicks
Return a high-resolution time value as a system-dependent integer
value.  The unit of the value is system-dependent but should be the
highest resolution clock available on the system such as a CPU cycle
counter. This value should only be used for the relative measurement
of elapsed time. 

Acknowledgements

Thanks to Simon Peyton Jones and the ghc team who I've been working with
over the summer at microsoft cambridge to develop the full release
of this FranTk. Thanks also to Johannes Waldmann did a lot of work to
get this version of FranTk working with ghc-5.

The FranTk License

Acknowledgements

FranTk was developed by Meurig Sage. It uses Fran and TclHaskell.
Fran was developed by Conal Elliott. 
TclHaskell is based on TkGopher 1.0 by  Wolfram Schulte,
Thilo Schwinn, Daniel Tuijnman and Ton Vullinghs. The first release
was developed by Chris Dornan, the full release by Meurig Sage.

License

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above acknowledgements notice,
this list of conditions and the following disclaimer.
 
- Redistributions in binary form must reproduce the above
  acknowledgements notice, this list of conditions and the following
  disclaimer in the documentation and/or other materials provided with
  the distribution.
 
- The names of the authors or contributors may not be used to endorse or 
  promote products derived from this software without specific prior 
  written permission. 

THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
