From: Wolfgang T. <wol...@gm...> - 2003-09-17 20:11:36
|
The wxHaskell website says: > Furthermore, most wxHaskell applications do not work correctly when > started from GHCi (and it is unclear what exactly causes this > problem). Mac OS X distinguishes between GUI processes and "background only" processes. A program that does not have the right extra information (a Mac OS resource fork or an Info.plist in a .app wrapper), is a background only process by default. For reasons of tradition (it's almost theoretically impossible in Mac OS 9), there's no documented way to change the status of a process from "background only" to "GUI app". ... but there's an undocumented way to do it! The attached module contains enableGUI :: IO (), which makes the current process a GUI process and brings it to the front. Notes: It uses undocumented functions (four of them, actually); therefore I don't recommend including this in wxHaskell's start function. Programs that use or even just link to this function might not run on future versions of Mac OS X. It is OK to invoke enableGUI as often as you want, even when it's not necessary. The menu bar sometimes stays blank when the application is not in the foreground when it is initialized. Therefore, don't issue enableGUI and main as separate commands in GHCi, use enableGUI >> main instead. |