• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: top most window question when it is launched by another app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: top most window question when it is launched by another app


  • Subject: Re: top most window question when it is launched by another app
  • From: Mike Bellerby <email@hidden>
  • Date: Wed, 9 Jul 2008 15:28:00 +0100

In BB.app do [NSApp activateIgnoringOtherApps:YES]; before showing the window.

Cheers
Mike

On 9 Jul 2008, at 15:10, xiaobin wrote:

Hello,
I have these question for several days.

1. How to make the modal window become the top most when the modal
window is launched from another application by using NSTask?

2. And I also want to know the types of window in  cocoa application.
Is there only modal window in cocoa app when I use method [NSWindow:
runModalForWindow:] etc.

3. method  [NSWindow:  orderFrontRegardless] is not useful for
NSAlert, when I use it as follow:

NSAlert* alert;
[alert runModal];
[[alert window] orderFrontRegardless];

The following is the detail of the questions:
I am using modal window for my application named BB.app.

In my BB.app, I use many modal window, for example a panel for showing
webview, a panel for showing progress bar and an alert for showing
information and waring by using NSAlert, etc.

I have another app for example named AA.app. I want to launch BB.app from AA.app

In AA.app, I use method setLaunchPath of NSTask to launch BB.app
because it is necessary to pass an argument to BB.app. And so the
method launchApplication of NSWorkspace is not useful because of the
argument.

so my question is when BB.app was launched by AA.app, the modal window
of BB.app is not the top most.
I tried to use the method of [NSWindow:  orderFrontRegardless] to
control the order of the modal windows of my BB.app. It is true that
the progress bar panel and the panel with webview are bacame the top
most, but the method [NSWindow:  orderFrontRegardless] is not useful
for NSAlert,

To investigate the question, I did a try. I tried to launch the
application TextEdit by an application with a window using NSTask

[NSTask setLaunchPath:@"/Application/TextEdit.app/Contents/MacOS/ TextEdit"];

I found the launched window of TextEdit is behind the launching window
of launching application.

(And I also found if I use [[NSWorkspace sharedApplication]
launchApplication:@"TextEdit.app"]; to launch TextEdit application,
the TextEdit winodw become the top most.)

Would anyone can help me?

Thank you for any help.
--
xiaobin
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >top most window question when it is launched by another app (From: xiaobin <email@hidden>)

  • Prev by Date: afferentless mac mini
  • Next by Date: Re: Finding AS related memory leak
  • Previous by thread: Re: top most window question when it is launched by another app
  • Next by thread: afferentless mac mini
  • Index(es):
    • Date
    • Thread