[Haskell-cafe] FLTK bindings near completion. Need community assistance ...
Ben Franksen
ben.franksen at online.de
Thu Feb 19 17:54:16 UTC 2015
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<Fl_Positioner*>(positioner))-
>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<Fl_Positioner*>(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
More information about the Haskell-Cafe
mailing list