Skip to content

Latest commit

 

History

History
 
 

samples

Examples

This folder contains the code examples for the Threepenny GUI library.

To run the examples, you can (but don't have to) use the provided runhaskell and ghci scripts:

cd samples
./runhaskell Chat.hs

These scripts check whether you have set up a cabal sandbox or, alternatively, the stack utility for use with this library, and uses these instead of the global package database; this is very useful for me as a library author.

(To set up the examples with stack, do the following

git clone https://github.com/HeinrichApfelmus/threepenny-gui.git
cd threepenny-gui/
stack init
stack setup
stack build
cd samples
./runhaskell Mouse.hs

)

After you have started an example, open your web browser and point it to the address http://localhost:8023. Enjoy!

Here a description of the currently maintained examples.

There are also a few other examples that are used for testing or that demonstrate library internals. They won't be maintained.

  • WorkaroundFastEvent.hs — Demonstrates how to register an event handler without requiring a response from the browser window.