Questions tagged [ghcjs-dom]

15 questions
19
votes
1 answer

Installing webkitgtk3 for GHCJS on osx

I'm trying to install the ghcjs-dom package on Mac OSX. It's been bumpy as there are a lot of dependencies. Webkitgtk3 is my current nemesis cabal install ghcjs-dom Resolving dependencies... Configuring webkitgtk3-0.14.1.1... Failed to install…
Mark Karavan
  • 2,654
  • 1
  • 18
  • 38
8
votes
1 answer

GHCJS-DOM event guidance

I'm trying to understand how to create a GUI with GHCJS-DOM. I've been looking at the hello world example https://github.com/ghcjs/ghcjs-dom-hello, which is trivial. Adding new nodes is straightforward. What I can't do, and cannot work out from the…
OllieB
  • 1,431
  • 9
  • 14
4
votes
0 answers

Can't get `dispatchEvent` to fire in GHCJS

The goal is to get window.addEventListener("popstate", ... to fire from an event dispatched from GHCJS code. Tried so far GHCJS.DOM doesn't work w <- currentWindowUnchecked e <- newPopStateEvent "popstate" Nothing dispatchEvent_ w…
Fresheyeball
  • 29,567
  • 20
  • 102
  • 164
4
votes
3 answers

How to convert a ByteString value to a JSVal

In the module GHCJS.DOM.JSFFI.Generated.CanvasRenderingContext2D there is the function putImageData with the following type: putImageData :: Control.Monad.IO.Class.MonadIO m => CanvasRenderingContext2D -> Maybe GHCJS.DOM.Types.ImageData ->…
Jogger
  • 1,617
  • 2
  • 12
  • 22
3
votes
0 answers

Using Web Component HTML tags with reflex

I try to use Web Components in Reflex. Code is as such: buttonUI5 :: DomBuilder t m => T.Text -> m (Event t ()) buttonUI5 t = do (e, _) <- element "ui5-button" def $ text t return $ domEvent Click e For ui5-button it worked as expected. Other…
3
votes
1 answer

Map of GType to function transforming a type to an IO String

This map is between a GType and an function that transforms an instance of that GType to an IO String. I am making a function that takes an element and gets a string representation of that element. mapping = [ (Types.gTypeHTMLSourceElement,…
michaelmesser
  • 3,601
  • 2
  • 19
  • 42
2
votes
1 answer

manage events in Haskell

I'm currently working with GHCJS.DOM/JSDOM in Haskell with the aim of create a small web application. In order to capture the event "click on a button" I write the following code: releaseAction <- on element click $ do w <-…
2
votes
1 answer

Installing reflex-dom likely to break ghcjs

I am trying to install reflex and reflex-dom using cabal install I got the following error messages: $ cabal install reflex-dom ... cabal: The following packages are likely to be broken by the…
john mangual
  • 7,718
  • 13
  • 56
  • 95
1
vote
1 answer

how to change

tags with ghcjs-dom

I have found the ghcjs and ghcjs-dom documentation very limited. Here is this basic HTML document. h1 { font-family: Helvetica; } p {font-family: Helvetica; color: blue; }

Hello World

This is my test document.

I…
john mangual
  • 7,718
  • 13
  • 56
  • 95

1
vote
1 answer

Using GHCJS-DOM without webkitgtk

I have installed GHCJS and compiled a few "Hello, World" programs. Now I'd like to work with the DOM. Does anyone know if it is possible to install the ghcjs-dom package without webkitgtk? I'm having a lot of difficulty loading the webkitgtk…
Mark Karavan
  • 2,654
  • 1
  • 18
  • 38
0
votes
1 answer

problem with the installation of ghcjs-dom: out of memory installing jsaddle-dom

I have tried to install ghcjs-dom both with cabal or stack and I can't exclude jsaddle-dom. In particular, by making "stack build", it tries to install also jsaddle-dom, but my OS goes out of memory during the process. How can i fix it? The ReadMe…
0
votes
1 answer

removing the current listener from within EventM

Suppose I want to create, using ghcjs-dom, an event listener which responds to a click, and then removes itself. I have addListener :: (IsEventTarget t, IsEvent e) => t -> EventName t e -> SaferEventListener t e -> Bool -> IO…
0
votes
1 answer

Filter [Node] to [Element] with ghcjs-dom

I am using ghcjs-dom. How can I filter the elements out of an array of nodes? import GHCJS.DOM.Types nodesToElements :: [Node] -> [Element] nodesToElements = ?? or nodesToElements :: [Node] -> IO [Element] nodesToElements = ??
michaelmesser
  • 3,601
  • 2
  • 19
  • 42
0
votes
1 answer

Is there a built in function to convert a NodeList to a real list (ghcjs-dom)?

How can I convert the result of Element.querySelectorAll body "h1" which is IO NodeList to IO (List Node). I know I could write a function myself. Is there a builtin function?
michaelmesser
  • 3,601
  • 2
  • 19
  • 42
0
votes
1 answer

ghcjs-dom-hello world does not respond to mouse clicks - ghc 7.10.1

I suppose this example should respond to mouse clicks: https://github.com/ghcjs/ghcjs-dom-hello , right ? But when I try it with GHC 7.10.1 under Firefox and Chrome nothing happens when I click on the page. Any ideas ? I haven't tried it with GHC…
jhegedus
  • 20,244
  • 16
  • 99
  • 167