Threepenny is a Haskell GUI framework that uses the web browser as a display. It is designed for easy setup across different operating systems. Threepenny includes built-in support for functional reactive programming (FRP).
Questions tagged [threepenny-gui]
55 questions
3
votes
0 answers
How to build Infinite-scroll listbox using threepenny-gui
Hello Haskell and Threepenny-GUI community,
I want to display a ListBox which has infinite scrolling support. I have a table in an SQLite database with 100k - 1000k rows. I want to display rows in a ListBox. I got help from this post…

user5126372
- 31
- 1
3
votes
1 answer
Combining Event and an attribute in threepenny-gui
I have an Event String which I want to sink into a textarea. This works fine, but now I want to combine the current value of a checkbox selection to this string.
First I did this by using checkedChange of the checkbox which works, but has a problem.…

655321
- 195
- 6
3
votes
1 answer
Haskell UI do clause, how to print?
This is a follow up question to this. I'm using a graphic library in Haskell called Threepenny-GUI. In this library the main function returns a UI monad object. I'm trying to execute a simple print command with no success. What is a right work…

vondip
- 13,809
- 27
- 100
- 156
3
votes
0 answers
Strange behavior of accumE with Event (UI a -> UI a)
I'm experimenting with threepenny-gui, trying to learn the FRP interface. I want to avoid all explicit shared state using accumE/accumB, instead of IORef:s. I have four different signals (start, stop, timer, reset) which all affect a global state…

Jonas Juselius
- 195
- 10
3
votes
2 answers
Installing threepenny-gui with cabal: what did I do wrong?
I tried installing threepenny-gui, and may have broken things in the process. My questions are (1) how can I fix that, and (2) how should one proceed when cabal issues a warning about possible reinstalls?
threepenny-gui warned me that it might…

Jeffrey Benjamin Brown
- 3,427
- 2
- 28
- 40
3
votes
1 answer
How do I get the arrow keys to change the focus to the next element in a threepenny-gui grid?
The tab key changes the focus in a grid to the next element. How do I get the up/down/left/right arrow keys to work also?

b1g3ar5
- 53
- 2
- 4
3
votes
2 answers
Design a drawing api for Canvas
I am adding some function to threepenny ui api.
I would like to had the ability to draw line with canvas.
The function that I can write have the following signature:
moveTo :: Vector -> UI ()
lineTo :: Vector -> UI ()
stroke :: UI ()
strokeStyle ::…

mathk
- 7,973
- 6
- 45
- 74
3
votes
1 answer
Element from Behavior (Functional Reactive Programming)
I'm just trying to get started with FRP and threepenny-gui, and I'm not sure how to do even basic things.
Suppose I have a function defined as so
timesClicked :: Element -> Behavior Int
timesClicked elem = accumulate (+) 0 (1 <$ UI.click elem)
and…

Theo Belaire
- 2,980
- 2
- 22
- 33
2
votes
1 answer
Stack auto-removes dependency from .cabal file following 'stack build'
I want to work on a new Haskell project using the threepenny-gui package.
The first thing I did was create a stack project via $ stack new threepennydemo. From here, here, I did the following:
I edited the extra-deps section in my stack.yaml file…

Eoin Dowling
- 373
- 3
- 15
2
votes
0 answers
threepenny-gui: close the window
Is it possible to close the window in threepenny-gui? I didn't find any Haskell-land functions like that in the package. I also tried runFunctions from both Core and Foreign.JavaScript but failed because neither of the Window types is marshable (no…

Artem Pelenitsyn
- 2,508
- 22
- 38
2
votes
1 answer
Threepenny GUI - Using sink with a canvas
I'm learning how to use Threepenny GUI, I've hooked up to a click event stream from a canvas, mapped that event stream to a stream of Point and applied accumB to [] and that Event Point to get a Behaviour [Point]
where Point:
data Point = Point {
…

Thomas Cook
- 4,371
- 2
- 25
- 42
2
votes
1 answer
Threepenny-GUI: Get Attribute Value as String
is there a way to get the attribute value (especially the id) of an element as a string?
For instance the following lines result in "()":
field <- UI.new
# set (attr "id") "some text"
on UI.drop field $ \_ -> do
-- Some label to print the…

m0.o
- 115
- 1
- 10
2
votes
1 answer
Update list of n UI values
I'm looking for a way to update an arbitrary number of UI.inputs based on a valueChange in any of the inputs.
Here is a toy example with just two inputs:
import qualified Graphics.UI.Threepenny as UI
import Graphics.UI.Threepenny.Core
import…

user3474009
- 311
- 1
- 4
2
votes
0 answers
How to Write to stderr or files in Threepenny
I am using Threepenny (hello Heinrich!) to construct an image database GUI.
As part of the diagnostic and development phase, whenever I attempt to write diagnostic files to /static (or anywhere else), Threepenny seems to throw a wobbly (only showing…

Charles Schatz
- 76
- 3
2
votes
0 answers