[web-devel] Rich Internet Applications using Haskell
Bardur Arantsson
spam at scientician.net
Thu Feb 10 08:36:20 CET 2011
On 2011-02-10 08:12, Bardur Arantsson wrote:
[--snip--]
> Immediate plans:
[--snip--]
Oh, and I forgot:
Widget composability. I'm not really sure how best to proceed with this
and whether it's really necessary. The current "workaround" is to have
ordinary Haskell functions (running in the CallbackM monad) which take a
set of event handlers as callbacks and which return a container widget.
Something like:
mkMyLastNameFormWidget :: CallbackM -> CallbackM Panel
mkMyLastNameFormWidget onChange = do
p <- mkPanel
label <- mkLabel "Last name:"
input <- mkInput
addToPanel p label
addToPanel p input
return p
Getting at the "composed" state is not trivial, though. Currently that
would require mkMyLastNameFormWidget to also return the "input" widget
which would break encapsulation.
Cheers,
More information about the web-devel
mailing list