Jules Bean | 3 Mar 2008 08:27
Picon

Trouble with wxhaskell on OSX (Intel/10.4)

Hi,

I have just tried to build wxhaskell on my Intel MacBook Pro, with OSX 
10.4 and ghc-6.6.1.

This is how it went:

Here are some notes on my attempt to compile wx-0.10.2 with ghc 6.6 on
an Intel MacOS X 10.4 platform.

Download wxMac-2.6.4.tar.gz from wx official home page.

carried out the following steps:

less INSTALL-MAC.txt
mkdir osx-build
cd osx-build/
../configure  --with-opengl
make -j3
sudo make install

then I tested some of the demo apps in-place, and that seemed to work 
well. 'bombs', 'life', etc: all seem to work well.

then wxcore:

cd wxcore-0.10.2
./configure
make
sudo make install
(Continue reading)

Eric Y. Kow | 3 Mar 2008 09:17
Picon
Gravatar

Re: Trouble with wxhaskell on OSX (Intel/10.4)

Hi,

> But, it doesn't quite run fine. Where the button is supposed to be 
> labelled 'Quit', it's labelled 'Q', and where the window itself is 
> supposed to be labelled "Hello!", it's just labelled 'H'.

Ah! You need to configure wxWidgets with --enable-unicode.

Maybe we should work out a way for the configure script to detect if
wxWidgets is unicode-enabled or not.

--

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Jules Bean | 3 Mar 2008 11:11
Picon

Re: Trouble with wxhaskell on OSX (Intel/10.4)

Eric Y. Kow wrote:
> Hi,
> 
>> But, it doesn't quite run fine. Where the button is supposed to be 
>> labelled 'Quit', it's labelled 'Q', and where the window itself is 
>> supposed to be labelled "Hello!", it's just labelled 'H'.
> 
> Ah! You need to configure wxWidgets with --enable-unicode.
> 
> Maybe we should work out a way for the configure script to detect if
> wxWidgets is unicode-enabled or not.
> 

D'oh!

Thanks.

Reconfigured, rebuilt and all is fine.

I hope to write some test wxhaskell code in a day or two and I'll report 
how it goes.

Jules

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Jeremy O'Donoghue | 12 Mar 2008 10:50
Picon

ANNOUNCE: wxHaskell 0.10.3 rc1

We are pleased to announce the first release candidate of wxHaskell
0.10.3.

This is the first update with binary packages available since June 2005,
and is the result of a great deal of work by a new team of contributors.

We are hoping to make a full release shortly, and issues and bug reports
either through the wxHaskell user mailing list
(wxhaskell-users@...) or via the Sourceforge bug tracker
(http://sourceforge.net/tracker/?group_id=73133&atid=536845).

Highlights of 0.10.3 rc1 include:

- Support for Unicode builds of wxWidgets
- Support for additional widgets including calendar, toolbar divider,
styled text control (wxScintilla), media control
- Support for clipboard, drag and drop
- Support for 64bit (Linux) targets
- Support for wxWidgets 2.6.x (support for wxWidgets 2.4.2 retained if
you compile from source)
- Support for building with GHC 6.6.x and 6.8.x
- Parts of wxHaskell are now built with Cabal
- New test cases
- Removed support GHC version < 6.4
- Profiling support
- Smaller generated binary sizes (using --split-objs)

Binary packages are available from the wxHaskell download site at
http://sourceforge.net/project/showfiles.php?group_id=73133, for the
following platforms:
(Continue reading)

Eric Y. Kow | 13 Mar 2008 11:26
Picon
Gravatar

Google Summer of Code and wxhaskell TODOs

Hi everyone,

We have been recently discussing the possibility of mentoring a
wxHaskell project.  Shelarcy (Kido Takahiro), in particular, is
interested in being a mentor.

I would like to solicit ideas for possible projects and to see if
there is anybody would would be interested in working on such a
project.

One idea we had was to implement XRC support.  XRC is an XML format for
describing wxWidgets interfaces.  It allows you to build your GUI using
visual tools like wxGlade, and load the results into your application at
runtime.  This might be a useful thing to have.  We could also imagine
implementing support on this in phases, for example, starting with a
simple one-shot conversion and moving up to more dynamic use of the
format.

Do you have any other suggestions?

--

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
(Continue reading)

Jules Bean | 13 Mar 2008 14:49
Picon

Some WX questions - a couple of missing bindings and a segfault

Hi,

Thanks to Eric's help earlier, I managed to get wx running and run
some simple programs in it. I have run into the following
(unconnected) problems with the API:

There doesn't seem to be a binding to wxImage's "SetOption" call. I
need to this to save a JPEG at anything other than the default
quality. I'm loading in a JPEG, cropping, and saving out: if you
recompress that at low quality you really suffer from jpg artifacts.

There doesn't seem to be a binding to the "wxImage-from-WXStream"
constructor. In particular, it would be nice to have a version using a
wxMemoryInputStream so that you can load a wxImage from a Ptr, such as
if you get an image via a network protocol or embedded in a larger
file.

I have random segfaults when calling imageGetPixels. Seems to be with
a probability of something like 25%. Here is the code I've written
(which generates an openGL texture from a WX bitmap):

textureFromBitmap bmp = do
     image <- imageCreateFromBitmap bmp
     pixels <- imageGetData image
     putStrLn $ "pixels : " ++ show pixels
     bytes <- peekArray 8 (castPtr pixels)
     putStrLn $ "bytes : " ++ show (bytes :: [Word8])
     WX.Size w h <- imageGetSize image
     putStrLn $ "Image size : " ++ show (w,h)
     pixs <- imageGetPixels image
(Continue reading)

Eric Kow | 13 Mar 2008 16:50
Picon
Gravatar

Re: Some WX questions - a couple of missing bindings and a segfault

Hi Jules,

Is this the same bug as this one from the Tracker?
  http://sourceforge.net/tracker/index.php?func=detail&aid=1003006&group_id=73133&atid=536845

(was submitted by Paul Johnson, I think)

Also, if you are so inclined, it would be extra-helpful if you could
submit your demonstrator as a test case in the bugs/ directory (darcs
send).  It would be extra-extra-helpful if you could work out a way to
reproduce this bug very consistently (for example, by repeatedly
loading the image in or something)

Thanks!

--

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Jules Bean | 13 Mar 2008 20:38
Picon

Re: Some WX questions - a couple of missing bindings and a segfault

Eric Kow wrote:
> Hi Jules,
> 
> Is this the same bug as this one from the Tracker?
>   http://sourceforge.net/tracker/index.php?func=detail&aid=1003006&group_id=73133&atid=536845
> 
> (was submitted by Paul Johnson, I think)
> 
> Also, if you are so inclined, it would be extra-helpful if you could
> submit your demonstrator as a test case in the bugs/ directory (darcs
> send).  It would be extra-extra-helpful if you could work out a way to
> reproduce this bug very consistently (for example, by repeatedly
> loading the image in or something)

Hi Eric,

It does look like it could well be the same bug. Although seems 
surprising for there to be a hole in the memory? Perhaps it is being 
moved by GC... but GC doesn't move memory which was allocated by a C(++) 
library does it?

I can reproduce the bug simply by creating images over and over and over 
again.

Here is a fairly minimal testcase, at the bottom of this mail. It always 
seems to segfault for me, normally after about 5 iterations, sometimes 
as many as 22.

It's interesting that there is a very long pause before the segfault. 
That is, one iteration of creating an image is normally a tiny tiny 
(Continue reading)

Eric Kow | 13 Mar 2008 22:56
Picon
Gravatar

Re: Some WX questions - a couple of missing bindings and a segfault

Hi Jules,

Thanks for the test case.

It segfaults right away for me on Linux (iteration 0).  I don't even
need the bitmap to make it do this; just
   image <- imageCreateSized (WX.Size 256 256)

Also, I notice that it seems to happen Graphics.UI.WXCore.pixelBufferGetPixels

(This is via the old fashioned putStrLn style of debugging)

Do you confirm these?

--

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Jules Bean | 13 Mar 2008 23:05
Picon

Re: Some WX questions - a couple of missing bindings and a segfault

Eric Kow wrote:
> Hi Jules,
> 
> Thanks for the test case.
> 
> It segfaults right away for me on Linux (iteration 0).  I don't even
> need the bitmap to make it do this; just
>    image <- imageCreateSized (WX.Size 256 256)
> 
> Also, I notice that it seems to happen Graphics.UI.WXCore.pixelBufferGetPixels
> 
> (This is via the old fashioned putStrLn style of debugging)
> 
> Do you confirm these?

Yes.

And what pixelBufferGetPixels does is peekCStringLen, which is 
essentially reading the entire buffer that image owns.

Whereas the other bug report you pointed me to read the image's buffer 
more gradually, but still hit the same error.

So somehow, sometimes, we're getting an invalid pointer. Whether it's a 
pointer to a buffer which is too short, or a buffer which has been 
moved, or....

Jules

-------------------------------------------------------------------------
(Continue reading)


Gmane