fltkhs-demos: FLTKHS demos. Please scroll to the bottom for more information.

[ deprecated, graphics, mit, program, ui ] [ Propose Tags ] [ Report a vulnerability ]
Deprecated

FLTKHS demos moved to a separate package to keep the core package free of additional dependencies.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
fastcompile

Turn off optimizations for faster compilation

Enabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0.0.3, 0.0.0.5, 0.0.0.6, 0.0.0.7
Dependencies base (>=4 && <5), bytestring, directory (>=1.2.2.0), fltkhs (>=0.4.0.0), process, stm [details]
License MIT
Author Aditya Siram
Maintainer aditya.siram@gmail.com
Category UI, Graphics
Home page http://github.com/deech/fltkhs-demos
Source repo head: git clone http://github.com/deech/fltkhs-demos
Uploaded by deech at 2016-01-31T14:16:56Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Executables fltkhs-clock, fltkhs-browser, fltkhs-boxtype, fltkhs-bitmap, fltkhs-arc, fltkhs-table-sort, fltkhs-table-simple, fltkhs-table-spreadsheet-with-keyboard-nav, fltkhs-tree-simple, fltkhs-make-tree, fltkhs-doublebuffer, fltkhs-textdisplay-with-colors, fltkhs-texteditor-simple, fltkhs-table-as-container, fltkhs-nativefilechooser-simple-app, fltkhs-tile, fltkhs-pack, fltkhs-threads
Downloads 2571 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-28 [all 3 reports]

Readme for fltkhs-demos-0.0.0.3

[back to package description]

#Fltkhs-demos

These are end-to-end demos of [FLTKHS] 1, a Haskell Binding to the FLTK GUI Library

Fltkhs-demos aims not only to show off the features of the [fltkhs] 1 but also serve as a way of learning the API by example. For more thorough documentation on the [fltkhs] 1 API please see the [FLTKHS module] 2 of that package.

Introduction

The demos shipped with this package are listed in fltkhs-demos.cabal as separate Executable components. Once the package is installed they are installed to Cabal's standard /bin/ directory (usually ~/.cabal/bin on Linux).

Note that the executables are prefixed with "fltkhs-". This is in order to prevent the demo executables from stomping over applications of the same name the user might already have installed. Typing:

 > fltkhs-<TAB>

at the command line should show a complete list of available demos.

Alternatively you can do:

 > ls ~/.cabal/bin/fltkhs-*

Learning The API

Most of the demos are exact ports of those shipped in the 'test' directory of the <http://fltk.org FLTK> distribution. It is hoped the user will study the Haskell demo code side-by-side with the C++ demo code in order to understand the API. The section API Guide in the [FLKTHS documentation] 2 covers this in more detail.

Why is the demo code so un-Haskelly?

For being written in Haskell, the demo code is horrifyingly/amazingly imperative and stateful. Although it may repulse those who used to pure Haskell idioms it is that way for a reason.

The demo code was never meant to be idiomatic Haskell code but a way of showing as much of the API as possible. The API itself closely resembles the underlying C++ code which is imperative and stateful. This has the advantage of making the API easier to learn.

For instance, assuming FLTK was installed from source compare /src/Examples/arc.hs with /test/arc.cxx in the FLTK source directory. There is quite a bit of correspondence and it is easy to see how the Haskell API functions map to the C++ ones.

Fast Compilation Flag

This package comes with a Cabal flag fastCompile that is enabled by default and speeds up compilation. More information on this flag is available under the Compilation section of the [FLTKHS documentation] 2.

To disable this flag, tell Cabal to ignore it during the configure step:

cabal configure -f-fastCompile

GHCi

The recommended way to running the REPL in a fltkhs application is cabal repl. For example to run the fltkhs-arc example do:

cabal repl fltkhs-arc

NOTE: For now it only works in GHC 7.8.x. GHC 7.10.x has an unfortunate regression that crashes GHCi because it cannot find symbols in the C library that contains the C++ bindings. This has been fixed in GHC 8. More information is available in the [ticket] 4.