• 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
Solved: Modal NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solved: Modal NSWindow


  • Subject: Solved: Modal NSWindow
  • From: Luc Vandal <email@hidden>
  • Date: Thu, 10 Mar 2005 22:30:23 -0500

- (id)sender
{
[NSApp stopModalWithCode:NSOKButton];
}

- (id)sender
{
[NSApp stopModalWithCode:NSCancelButton];
}


On 10-Mar-05, at 9:26 PM, Luc Vandal wrote:

Yeah I got that part covered now! The only problem I have so far is that the pointer to the window remains null. I added an outlet to my controller class for that window but it's not being initialized or something. Perhaps I did something wrong in IB?

Thanks!


On 10-Mar-05, at 9:15 PM, Justin Spahr-Summers wrote:

<http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSApplication.html>

runModalForWindow:

- (int)runModalForWindow:(NSWindow *)aWindow
Starts a modal event loop for aWindow. Until the loop is broken by a
stopModal, stopModalWithCode:, or abortModal message, the application
won't respond to any mouse, keyboard, or window-close events unless
they're associated with aWindow. If stopModalWithCode: is used to stop
the modal event loop, this method returns the argument passed to
stopModalWithCode:. If stopModal is used, it returns the constant
NSRunStoppedResponse. If abortModal is used, it returns the constant
NSRunAbortedResponse. This method is functionally similar to the
following:

[code here]

The window aWindow is placed on the screen using NSWindow's center
method, if not already visible, and made key as a result of the
runModalForWindow message. Do not send NSWindow's
makeKeyAndOrderFront: to aWindow.

On Thu, 10 Mar 2005 20:57:27 -0500, Luc Vandal <email@hidden> wrote:
Hi!

can anyone show me how to display a modal NSWindow? I don't know what
has to be done to initialize the window and to display it. By the way,
the window is in the main nib file.

Thanks!

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Modal NSWindow (From: Luc Vandal <email@hidden>)
 >Re: Modal NSWindow (From: Luc Vandal <email@hidden>)

  • Prev by Date: Modal sheet
  • Next by Date: Re: NSGLImage doesnt open large images
  • Previous by thread: Re: Modal NSWindow
  • Next by thread: Modal sheet
  • Index(es):
    • Date
    • Thread