[wxhaskell-users] Fwd: UI updates from non-UI threads: an addition to wx?
Including wxhaskell-users. Anyone interested in async UI update functionality? Cheers, Maciek -- Forwarded message -- From: Date: Fri, Aug 24, 2012 at 10:41 PM Subject: UI updates from non-UI threads: an addition to wx? To: wxhaskell-devel Getting wxHaskell to handle UI updates from non-UI threads was a frustrating experience; it's embarassing how long it took me to realise that the solution presented in this StackOverflow answer: http://stackoverflow.com/a/3182588/424978 is probably the only viable one. I've packaged it into a tiny module that provides Gtk2hs-style `postGUIAsync` function: https://github.com/mmakowski/habaz/blob/master/src/Graphics/UI/WX/Async.hs. Is there any interest in incorporating this into wxHaskell proper? It might save other users some head scratching. Regards, Maciek -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
Re: [wxhaskell-users] monospace font in TextCtrl
On Tue, 25 Sep 2012, Heinrich Apfelmus wrote: > Henning Thielemann wrote: >> When switching from wxcore-0.13.2 to GIT HEAD from >> https://github.com/jodonoghue/wxHaskell the TextCtrl does no longer use a >> monospaced font. This may be caused by the recent patch commented with >> >>"Fix for unexpected TextCtrl behaviour on OS X. This is the equivalent >> of patch f225d0c on master." >> >> I create the text field this way: >> WX.textCtrl panel [ font := fontFixed, wrap := WrapNone ] >> >> In the past TextCtrl always used a monospaced font, but when I entered >> text at the end of a text field it happened sometimes that the font had no >> longer fixed width characters. This might be a wxwidgets bug or even a gtk >> bug. However, now the TextCtrl does not use the monospace font anymore. > > You can use the textCtrlEx function and pass additional style flags to > it to create text controls with the old behavior. I think the previous > source code was > > textCtrlEx parent (wxTE_MULTILINE .+. wxTE_RICH2) props I see. It sounds reasonable, too. Unfortunately switching back to this line does not work. Even if it would, it would bypass the improvement that was introduced with the last patch. There were not many lines that changed, so I tried to revert them one by one and found that this change caused the problem: -(\tc -> (textCtrlGetValue tc, \s -> do textCtrlClear tc; textCtrlWriteText tc s)) $ +(\tc -> (textCtrlGetValue tc, \s -> do textCtrlChangeValue tc s)) $ It may be related to my observation that the textCtrl sometimes chooses a variable-space font if I enter text at the end of a text Ctrl in an otherwise mono-spaced text. That is, it seems to be important _how_ a text is inserted. Maybe this is even a Wx bug? -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
[wxhaskell-users] type safe handling of flags
I don't know whether I proposed it already ... I wrote a package called enumset. It provides low-level bitsets like they are used by wxWidget. The definition is essentially: newtype EnumSet storage index = EnumSet storage E.g. with data Style = Bold | Italic | Underlined deriving (Enum) the type (EnumSet Word32 Style) represents a subset of {Bold, Italic, Underlined} stored as a bitfield in a Word32. http://hackage.haskell.org/packages/archive/enumset/0.0.4/doc/html/Data-EnumSet.html The other modules can be used to manage bitfields where not individual bits must be processed, but there are groups of bits, where each group represents a value. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users
Re: [wxhaskell-users] monospace in TextCtrl
Henning Thielemann wrote: > When switching from wxcore-0.13.2 to GIT HEAD from > https://github.com/jodonoghue/wxHaskell the TextCtrl does no longer use a > monospaced font. This may be caused by the recent patch commented with > >"Fix for unexpected TextCtrl behaviour on OS X. This is the equivalent > of patch f225d0c on master." > > I create the text field this way: > WX.textCtrl panel [ font := fontFixed, wrap := WrapNone ] > > In the past TextCtrl always used a monospaced font, but when I entered > text at the end of a text field it happened sometimes that the font had no > longer fixed width characters. This might be a wxwidgets bug or even a gtk > bug. However, now the TextCtrl does not use the monospace font anymore. You can use the textCtrlEx function and pass additional style flags to it to create text controls with the old behavior. I think the previous source code was textCtrlEx parent (wxTE_MULTILINE .+. wxTE_RICH2) props Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users