|
From: Claus R. <cla...@ta...> - 2004-06-16 15:20:04
|
continuing my wxhaskell experience, I have to say the library (wxwidgets) is lower
level than I had expected. Worse, the level is not consistent, so there are predefined
high-level gadgets for some uses while even lower-level support for other uses is
incomplete. And sometimes, there are helper functions which, when used, can
lead into traps in which intended tasks seem impossible or tricky, while direct use
of base-level functionality avoids these difficulties.
Now, the obvious question is: is this just my impression?-)
If not, it might be useful to try and hunt down some of these odd corners that
most of us learn to program around, and instead let Daan know about them so
that he can try to improve wxhaskell's design before the 1.0 release (to the
extent permitted by wxwidget's design). Here are some small examples:
- event filters like click, drag, etc. only propagate part of the even info.
superficially, that makes simple uses look simple, but it means that one
is soon forced to abandon all of this in favour of keyboard, mouse, etc.,
why not pass on the full event? it is trivial to extract just the position,
if that's sufficient for the task at hand.
- on click seems to react on MouseDown already.
- on drag would be more useful if it supplied the Vector of movement
relative to the last handler call, instead of (or in addition to) the
current Point. as it stands, that functionality is bound to be
reimplemented by every user.
- instead of explaining the usage pattern for extending handlers, why not
capture it in a set of functions, like this one:
addHandler1 handler previous x = do {handler x; previous x}
..
,on drag := dragHandler vContext
,on mouse :~ addHandler1 (recordMouseDownPos vContext)
,on mouse :~ addHandler1 (selectionHandler vContext)
..
- why, oh why, are there types with Show instances that have no Read
instances (Point, Vector, ..)? makes it needlessly hard to save/restore
GUI state.
- why is Vector scaling limited to Int, while Vector length is reported in
Double? that means I'm forced to de- and re-construct my Vectors and
provide my own Double-scaling.
- less small, but would be useful: support for polar coordinates is missing
I'm sure there are more, and rumours have it that 1.0 is close, so it would
be nice if you experienced wxhaskell users could help to improve the
experience for future users, by collecting the little niggles you've come
accross. We're all thankful to Daan for providing this binding, but he
can't practice-test all parts of it himself, after all.
Cheers,
Claus
|