[Haskell-cafe] Command Line Args passed to wxHaskell

Michael Jones mike at proclivis.com
Wed Mar 25 03:20:05 UTC 2015


I am seeing strange behavior with a wxHaskell app compiled on Windows 7.

On Linux, all is well. I can call my app like:

app +RTS -N4 -RTS myArg

And in the app I can process the myArg and start a wxHaskell frame.

When I compile the same application on Windows 7, I get an error dialog box that says:

“Unexpected parameter `+RTS`. And a second Usage dialog that looks like it comes from wxHaskell.

I am not sure why Windows is different, but perhaps it is the fact that on Windows 7 I compiled up wxHaskell 0.92, and on Linux I used 0.91 from a cabal update. I used 0.92 on on Windows because I could not get 0.91 to compile due to some type problems where the wxPack version was incompatible with a header file and the Haskell compiler related to 64 bit types long long. There is some noise about this on the web, but no solutions.

Nonetheless, I assume that args are grabbed directly by wxHaskell and Environment.getArgs does not consume them such that they are still available to wxHaskell.

Is there some way to consume arguments so they are no longer available or a way to modify them so that when wxHaskell starts up it sees arguments I can control in code?

In wx there is an API to set arguments, but it does not seem to be part of wxHaskell. So I think I need something I can do outside the wxHaskell API.

Mike


More information about the Haskell-Cafe mailing list