• 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
Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]


  • Subject: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
  • From: Motti Shneor <email@hidden>
  • Date: Wed, 14 Oct 2009 09:02:54 -0400
  • Acceptlanguage: en-US
  • Thread-topic: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]

Hello.

I'm in a strange situation, where I am implementing a plugin component
that runs within a host application which I don't have access to.

Within this context, The host sometimes calls my plug-in to open an
NSSavePanel (or NSOpenPanel). The host expects that I'm synchronous
--- i.e. I only return when the NSSavePanel is dismissed, and there's
a result.

However, The host also provides me with its own Window, and I need to
open my NSSavePanel as a Sheet-window over the host's window.

Now NSSavePanel (and NSOpenPanel) provide 2 different ways to run them

1. runModal (or a vaiant) that is synchronous --- but it does not
create a sheet window
2 beginSheetFor... (or variants) that are asynchronous (I must supply
with a callback selector to be called
as the NSSavePanel is dismissed) --- these DO create a sheet over the
parent window.

Is there a decent way to combine these two requirements? Can I somehow
call

{
.
.
.

NSSavePanel *myPanel = [NSSavePanel panel];
[myPanel setParentWindow: hostWindow];
[myPanel runModal]

// and here, call something to block until the dismissal callback is
called?
[somehow block here]

// extract the result.
return;
}

Thanks a lot!


Motti Shneor
------------------------------------------
Senior Software Engineer
Waves Audio ltd.

_______________________________________________

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

  • Follow-Ups:
    • Re: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
      • From: Steve Christensen <email@hidden>
    • Re: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: Code Sign verification on Leopard
  • Next by Date: Re: SelectedRowIndexes
  • Previous by thread: Re: shared preferences.
  • Next by thread: Re: Opening a NSSavePanel as a Sheet, and blocking like in [panel runModal]
  • Index(es):
    • Date
    • Thread