WX.colorDialog returns Just (rgba (255,255,255,255)) when the Cancel button was pressed. But wxhaskell manual says: "Returns Nothing when Cancel was pressed".
Testing with current darcs tip (0.13.1) and wx 2.8 on Windows, the behaviour is different: pressing cancel results in Just (rgba (0,0,0,0)).
You seem to have CSS turned off.
Please don't fill out this field.
There have been two issues around this:
1. colorIsOk function in WxcTypes.hs was assuming that invalid colour will have rgba < 0, but rgba is a Word, i.e. non-negative;
2. wxColour_IsOk function in eljcolour.cpp was returning a bool, but the foreign import in WxcTypes was expecting a CInt. This might work on platforms where sizeof(bool) == sizeof(int), but doesn't work e.g. on Windows under gcc, where sizeof(bool) == 1.
I couldn't figure out how to attach a patch to this ticket so sent it to the devel mailing list.
Any updates on this?
At least on Linux, the color dialog does not show an alpha channel. So, the temporary workaround is to use the `colorAlpha' function to check if the resulting color's alpha is not 0.
Log in to post a comment.
Sign up for the SourceForge newsletter: