[Haskell-cafe] wxHaskell: getting a checkbox state

Mark Carter mcturra2000 at yahoo.co.uk
Wed Sep 14 11:15:55 EDT 2005

I'm a complete n00b to Haskell, and I am trying to write an experimental 
app using wxHaskell. I'm getting on suprisingly well, given that I have 
practially no idea what I'm doing.

In my main loop I have
    cbEdit <- checkBox p1 [text := "Edit Mode", on command :=  onCbEdit 
textlog   ]
where p1 is a panel, and textlog is a textCtrl that I want to write 
output to. In my where clause I have defined:

   onCbEdit textlog  = do
        appendText textlog "onCbEdit\n"

So far, this works. The thing that's got me totally stumped is this: 
suppose I want onCbEdit to do something dependent on the state of the 
checkbox (i.e. whether it is checked or unchecked). I've tried a variety 
of things, but I can't get anything to work.

To put things into a wider context, here's the message I posted to 
fa.haskell yesterday:

I'm the rawest of n00bs to Haskell. I was interested in evaluating it,
and I've seen some GUI stuff that looked pretty impressive.

I wanted to write a protoype for a commercial application to do
hydrocarbon accounting. Which is to say, you've a number of so-called
"streams" - think of them as graph nodes - feeding into each other in a
directed fashion (assume the graph is acyclic). Then there's a bunch of
business logic which determines how the values of one stream are
affected by the values in another. An example of a stream might be a
platform. Another one might be a well. Each stream would display on the
window as some funky symbol, with its name underneath.

It would be nice if the application had an edit mode, where you could
add, move, delete, and join streams in a window; and a data mode, where
you could click on the stream you were interested in  and examine its

Is there a Haskell GUI toolkit which is particularly suitable for this?

Other requirements of the toolkit would be:
* Works on Windows (XP)
* commercial-friendly licence: GPL is out, and even LGPL is a bit
* free
* bonus points for being easy to use, and well-documented

To help you stay safe and secure online, we've developed the all new Yahoo! Security Centre. http://uk.security.yahoo.com

More information about the Haskell-Cafe mailing list