FLTK bindings near completion. Need community assistance ...

Hi all, I've been working on bindings [1] to the FLTK GUI toolkit [2] and I've come to the point where it's mostly complete but I could use some help from the community before I put it up on Hackage. My hope is to eventually fill the need in the Haskell ecosystem for a native GUI library that: - runs on all platforms - is easily installable - is small and fast - has a minimum of dependencies. Currently this library uses only base, stm, bytestring and c2hs. - is conservative with extensions. Currently the most recent extension required is GADTs. If any of this sounds good to you, I could use some help with: - testing the build on Linux and OSX. This should be as simple as installing FLTK, cloning the repo [1] and running `cabal build`. Better instructions are in included README. - getting it to build on Windows. I unfortunately don't have access to a Windows machine. - getting it to build on older GHC's. I used 7.8.3 because that is what I have, but it should work back to the first version of GHC that introduced GADTs. Unfortunately the included `Setup.hs` is non-trivial and I been having trouble getting it work with versions of Cabal older than 1.20 due to breaking API changes across versions. - building a single library. Currently the C/C++ wrappers and Haskell bindings are two separate statically linked libraries. They are copied to the same location so applications built with this package don't have to know that, but it would be ideal if it was all-in-one. - building a shared library on Mac OSX. Any other feedback you have is totally welcome. Thanks! -deech [1] https://github.com/deech/fltkhs [2] http://www.fltk.org/index.php

On Sun, 11 Jan 2015 12:39:40 -0600
aditya siram
Hi all, I've been working on bindings [1] to the FLTK GUI toolkit [2] and I've come to the point where it's mostly complete but I could use some help from the community before I put it up on Hackage.
What a great idea. Been a while since i used fltk, but when i did i found it to be quite nice to work with. hopefully i can help, at least a little...

Hi Deech. I build fltk and fltkhs on my MacBook Pro with Mac OS 10.9.5.
Everything went smoothly, and the examples run fine. -- Conal
On Sun, Jan 11, 2015 at 10:39 AM, aditya siram
Hi all, I've been working on bindings [1] to the FLTK GUI toolkit [2] and I've come to the point where it's mostly complete but I could use some help from the community before I put it up on Hackage.
My hope is to eventually fill the need in the Haskell ecosystem for a native GUI library that: - runs on all platforms - is easily installable - is small and fast - has a minimum of dependencies. Currently this library uses only base, stm, bytestring and c2hs. - is conservative with extensions. Currently the most recent extension required is GADTs.
If any of this sounds good to you, I could use some help with: - testing the build on Linux and OSX. This should be as simple as installing FLTK, cloning the repo [1] and running `cabal build`. Better instructions are in included README. - getting it to build on Windows. I unfortunately don't have access to a Windows machine. - getting it to build on older GHC's. I used 7.8.3 because that is what I have, but it should work back to the first version of GHC that introduced GADTs. Unfortunately the included `Setup.hs` is non-trivial and I been having trouble getting it work with versions of Cabal older than 1.20 due to breaking API changes across versions. - building a single library. Currently the C/C++ wrappers and Haskell bindings are two separate statically linked libraries. They are copied to the same location so applications built with this package don't have to know that, but it would be ideal if it was all-in-one. - building a shared library on Mac OSX.
Any other feedback you have is totally welcome.
Thanks! -deech
[1] https://github.com/deech/fltkhs [2] http://www.fltk.org/index.php
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

aditya siram wrote:
I've been working on bindings [1] to the FLTK GUI toolkit [2] and I've come to the point where it's mostly complete but I could use some help from the community before I put it up on Hackage.
My hope is to eventually fill the need in the Haskell ecosystem for a native GUI library that: - runs on all platforms - is easily installable - is small and fast - has a minimum of dependencies. Currently this library uses only base, stm, bytestring and c2hs. - is conservative with extensions. Currently the most recent extension required is GADTs.
I very much welcome the effort and are willing to help.
My system is ubuntu trusty (14.04.1 LTS). I am using ghc-7.6.3 from the
distribution and have almost all the existing packages for haskell libraries
installed. I usually try to get new stuff to compile with them and only
cabal install dependencies if that fails (but always in a sandbox, except
for cabal and cabal-install of which i have the latest versions).
I first tried to build your library with my distro's libfltk1.3-dev package.
This gave me errors early on:
==Compiling C bindings==
*** Compiling Fl_Menu_ButtonC.cpp...
*** Compiling Fl_PositionerC.cpp...
Fl_PositionerC.cpp: In function ‘void*
Fl_Positioner_top_window(fl_Positioner)’:
Fl_PositionerC.cpp:268:67: error: ‘class Fl_Positioner’ has no member named
‘top_window’
return (fl_Window) (static_cast
top_window(); ^ Fl_PositionerC.cpp: In function ‘void* Fl_Positioner_top_window_offset(fl_Positioner, int*, int*)’: Fl_PositionerC.cpp:271:67: error: ‘class Fl_Positioner’ has no member named ‘top_window_offset’ return (fl_Window) (static_cast
(positioner))- top_window_offset(*xoff,*yoff); ^ Fl_PositionerC.cpp: In function ‘void* Fl_Positioner_top_window(fl_Positioner)’: Fl_PositionerC.cpp:269:3: warning: control reaches end of non-void function [-Wreturn-type] } ^ Fl_PositionerC.cpp: In function ‘void* Fl_Positioner_top_window_offset(fl_Positioner, int*, int*)’: Fl_PositionerC.cpp:272:3: warning: control reaches end of non-void function [-Wreturn-type] } ^ make[1]: *** [Fl_PositionerC.o] Fehler 1 make: *** [src] Fehler 2
Then I looked at the exact version of the libfltk package and saw it is based on version 1.3.2. I then downloaded the 1.3.3 version and installed manually. But this failed, too, though much later in the process: src/Graphics/UI/FLTK/LowLevel/FL.chs:279:3: Ambiguous occurrence `unsafePerformIO' It could refer to either `Graphics.UI.FLTK.LowLevel.FL.unsafePerformIO', defined at src/Graphics/UI/FLTK/LowLevel/FL.chs:276:1 or `C2HS.unsafePerformIO', imported from `C2HS' at src/Graphics/UI/FLTK/LowLevel/FL.chs:150:1-47 (and originally defined in `Foreign') If I remove the unsafePerformIO work-around (thanks for the comment in the code), I get a few warnings but the build completes. Compiling the examples takes ages. I wonder why. The examples seems to work basically, though not without some rough corners. The first two I tried: hello-world: the window is too small, it cuts off the button on the right edge. Note that I am running xmonad as my window manager i.e. no window decorations. table-spreadsheet-with-keyboard-nav: I tuned the sliders to max and found that the scollbars behave strangely (the handles do not scale properly, clicking inside the empty area works only once). You can contact me off-list if you want more detailed feedback. Cheers Ben -- "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." ― C.A.R. Hoare
participants (4)
-
aditya siram
-
Ben Franksen
-
briand@aracnet.com
-
Conal Elliott