HeinrichApfelmus / threepenny-gui

GUI framework that uses the web browser as a display.
https://heinrichapfelmus.github.io/threepenny-gui/
Other
439 stars 77 forks source link

Adding Variadic Js function parameter and add coordinate on drag and drop event #97

Closed mathk closed 5 years ago

mathk commented 9 years ago

Here is two change in this pull request.

Thanks

HeinrichApfelmus commented 9 years ago

Thanks for the pull request!

  1. I prefer to not implement VariadicJSParam, but to use an alternative design instead. Namely, every function object in Java has a member apply which can be used to pass multiple arguments as an array, along the lines of

    ffi "aVariadicFunction.apply(null,%1)" arguments

    where arguments :: [Int] is a list of values. For this to work, we need to make lists [a] an instance of the ToJS class.

  2. Looks fine to me in principle, but I am not entirely sure which coordinates to use. There were some important issues with pageX not being absolute or relative, but I'll have to look up exactly what the semantics were. I think that mousemove implements it incorrectly, even.