Hi Jose,

Jose manuel Hernando Cobeña wrote:


-hello, I need to create a list of Colors, and I like do this:


list_colors <- varGet vColors
....
color_red <- checkBox p [text := "Red", checked := False, on command := do aux red list_colors ]
....
where
aux one_color list_colors =
if (elem one_color list_colors)
then do
varSet vColors (delete one_color list_colors)
else do
varSet vColors (red:list_colors)


but the variable vColors no change and I can not create de list of colors.

You should pass the variable to the helper function -- not its value. ie. this should work better:

...
colorRed <- checkBox p [text := "Red", on command := onRed red vColors]
...
where
  onRed color vColors
    = vColors [value :~ \colors -> if (color `elem` colors)
                                    then .. else color:colors]

I hope this helps,
 -- Daan.

ps. It is better to send wxHaskell related questions to
the [EMAIL PROTECTED] mailing list
instead of the Haskell list.


Thanks


------------------------------------------------------------------------
Localiza a tus ex compañeros de clase o trabajo. Date de alta gratis aquí. <http://g.msn.com/8HMBESES/2728??PS=47575>



------------------------------------------------------------------------

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to