From: Daan L. <daa...@xs...> - 2003-09-18 12:16:20
|
Wow Wolfgang -- how do you know about these devil-ish things!! :-) Thanks for the contribution. I think I'll put it on the webpage with the macosx notes. -- Daan. > -----Original Message----- > From: wxh...@li... > [mailto:wxh...@li...] On > Behalf Of Wolfgang Thaller > Sent: woensdag 17 september 2003 22:11 > To: wxh...@li... > Subject: [wxhaskell-users] wxHaskell + GHCi + Mac OS X > > > 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. > > |