Re: [wxhaskell-devel] wxString handling broken when using wx 2.9

2011-09-22 Thread Dave Tapley
On 20 September 2011 20:57, Dave Tapley duked...@gmail.com wrote:
 Hi Eric,

 Am I correct in recalling that you did some of the work to get wxHaskell
 supporting unicode?

 I've using wxHaskell with wxWidgets 2.9.2 (the latest development release)
 and it seems that any attempt to get back a wxString in Haskell code will
 result in a Prelude.chr: bad argument: crash at run time; I've verified
 that the same code works correctly with wxWidgets 2.8.

 A good example is ./samples/wx/ListCtrl.hs, you will get the crash when you
 click on an item in the list.

 Now the good news is that this is almost certainly related to the changes to
 unicode handling in wxWidgets:
 http://docs.wxwidgets.org/2.9/overview_changes_since28.html

 But I thought I'd send out a message asking for a sanity check before I get
 too busy working on fixing it.

 Dave,


Good news everyone!
This is fixed, at least for GTK2 with wx-2.9, I don't know if it
breaks building against previous versions, perhaps someone would like
to find out?

Dave,
Patch attached.


fix_for_prelude_chr_error
Description: Binary data
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel


Re: [wxhaskell-devel] wxString handling broken when using wx 2.9

2011-09-21 Thread eric.kow
On Tue, Sep 20, 2011 at 20:57:37 +0100, Dave Tapley wrote:
 Am I correct in recalling that you did some of the work to get wxHaskell
 supporting unicode?

That's right.  Mostly swapping char with w_char

 Now the good news is that this is almost certainly related to the changes to
 unicode handling in wxWidgets:
 http://docs.wxwidgets.org/2.9/overview_changes_since28.html

Ouch, seems to make sense.

Was dimly aware that wxWidgets 3.0 would be changing the string type but
I guess I let wishful thinking fool me into thinking it didn't affect
wxWidgets 2.9 (not really paying enough attention to the numbering)

-- 
Eric Kow http://erickow.com


pgpfmCMLeZJUY.pgp
Description: PGP signature
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel


Re: [wxhaskell-devel] wxString handling broken when using wx 2.9

2011-09-21 Thread David Virebayre
I have a probably stupid question, but I'll fire it anyways:

Would it make sense to have future versions of wxHaskell support Text
instead of String ?

David.

2011/9/21 eric.kow eric@gmail.com:
 On Tue, Sep 20, 2011 at 20:57:37 +0100, Dave Tapley wrote:
 Am I correct in recalling that you did some of the work to get wxHaskell
 supporting unicode?

 That's right.  Mostly swapping char with w_char

 Now the good news is that this is almost certainly related to the changes to
 unicode handling in wxWidgets:
 http://docs.wxwidgets.org/2.9/overview_changes_since28.html

 Ouch, seems to make sense.

 Was dimly aware that wxWidgets 3.0 would be changing the string type but
 I guess I let wishful thinking fool me into thinking it didn't affect
 wxWidgets 2.9 (not really paying enough attention to the numbering)

 --
 Eric Kow http://erickow.com

 --
 All the data continuously generated in your IT infrastructure contains a
 definitive record of customers, application performance, security
 threats, fraudulent activity and more. Splunk takes this data and makes
 sense of it. Business sense. IT sense. Common sense.
 http://p.sf.net/sfu/splunk-d2dcopy1
 ___
 wxhaskell-devel mailing list
 wxhaskell-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel



--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel


Re: [wxhaskell-devel] wxString handling broken when using wx 2.9

2011-09-21 Thread David Virebayre
2011/9/21 Eric Y. Kow eric@gmail.com:
 On Wed, Sep 21, 2011 at 16:36:55 +0200, David Virebayre wrote:
 I have a probably stupid question, but I'll fire it anyways:

 Hmm, worth a thought.

 Would it make sense to have future versions of wxHaskell support Text
 instead of String ?

 Do GUIs typically manipulate large text fields for which this would make
 sense?  Is String a source of overhead for any other reason (ie. lots of
 text fields)?  Do we care if we just of lots of small ones?  Is this a
 matter of convenience for people moving to using a lot more Text in
 modern Haskell?

I have no good answer to those questions. But, if I didn't read too
fast, I think wxwidgets uses UTF-16, which is also what is used in
Text.

I've made a little program and used Text to process Textual data which
I want to display in a GUI, so converting to String puts lots of
unwanted T.unpack here and there.

This is annoying enough that I wish I didn't use Text to begin with !
I think it's bad because
- Text is in the Haskell Platform, so it's the blessed way of dealing
with text data
- Takes less memory, faster, etc
- Not using it would slow its adoption

Since wxHaskell or wxWidgets probably has to convert that back to
UTF-16 at some point...

I'm probably thinking way ahead of time with this idea.

David.


 --
 Eric Kow http://erickow.com


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel