[MacOS] How to force an app to foreground?
Stefan.Neis at t-online.de
Stefan.Neis at t-online.de
Sun Feb 3 06:05:30 PST 2008
Hi,
I've a largish shell skript which works on both Linux and MacOS.
For occasional simple minded user interaction (like "Do you want
to include or omit some step?"), I've a simple wx-based application
which gets the question to display as an argument and returns the
user reaction via it's return code, i.e. in my shell skript, I
do something like
> AskQuestion.app/Contents/MacOS/AskQuestion "Do you want ...."; rc=$?
It's working nicely on Linux and _almost_ as nice on MacOS. The only
problem is that on MacOS, my application is always opened in the
background, i.e. partially hidden "behind" the terminal window. If a
user is particularly unlucky with the placement of windows, he might
have to move the terminal window aside to even see that there is
another window waiting for him to do something,which of course is bad.
I've been trying to use wxWindow::Raise function but it didn't help.
I've been trying to use OSX' "open", but I didn't manage to actually
pass the question I wanted to get answered by the user to it, so that
seems useless. Now, I found a suggestion to use "nohup" which sounded
like it might almost do what I need (I'll test that tomorrow), but
even if that really opens the window in the foreground, getting to
the "result" of the application probably will be a bit of a challenge...
Am I missing something obvious or is making use of GUI programs from
command line/shell scripts on MacOS really as complicated as it seems
to be?
Regards,
Stefan
More information about the wx-dev
mailing list