FAQ Database Discussion Community


How to reload updated file in Threepenny-gui 0.6?

haskell,threepenny-gui
The Threepenny-gui changelog (https://hackage.haskell.org/package/threepenny-gui-0.6.0.1/changelog) reads: "The functions loadFile and loadDirectory have been removed, as I felt that the jsStatic option is sufficient for most use cases." My question is: how can we reload an image that is updated during execution without loadFile? With Threepenny-gui 0.5 I used the following code:...

Haskell Threepenny Gui: Reading Color from Canvas at specific Point?

haskell,canvas,threepenny-gui
Is there a way to read the Color of a specific Point of a Canvas? Something like: getColor :: Canvas -> Point -> Color I checked the Documentation at Graphics.UI.Threepenny.Canvas, but couldn't find any function for that. Maybe I just didn't see it, for I am not that long using...

Combining Event and an attribute in threepenny-gui

haskell,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. If the...

Changes in other elements based on listbox selections in threepenny-gui

haskell,threepenny-gui
So I have a simple example layout with a listbox, a button and a textarea, where clicking the button changes the text in the textarea: import Control.Applicative import Control.Monad import Data.Maybe import qualified Graphics.UI.Threepenny as UI import Graphics.UI.Threepenny.Core main :: IO () main = startGUI defaultConfig setup setup :: Window...

Dynamic Elements based on Behaviour in threepenny-gui

haskell,frp,threepenny-gui
To put it simple, I am looking for a way to display a Behaviour (UI Element). My actual use-case is displaying a table, which can be filtered. So I have a function tableElement :: String -> UI Element (the String parameter being the filter condition) and an input field filterElement...

Using IORef in threepenny gui

haskell,threepenny-gui
I'm trying to set an IORef in threepenny-gui but I can't get it to work. In my app the IORef itself will be more complicated and not itself be displayed - but this example demonstrates the problem I think. Here is my try: testIORef2 :: IORef String -> Window ->...