beginSheet:modalForWindow:modalDelegate:didEndSelector:contextI nfo:
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextI nfo:
- Subject: beginSheet:modalForWindow:modalDelegate:didEndSelector:contextI nfo:
- From: email@hidden
- Date: Thu, 24 May 2001 10:47:15 -0500
Mr. Peyton,
thank you for your help with NSBeginSheet. i ended up figuring it out
shortly before you emailed me the answer by looking at TextEdit.app's
source code. Go figure. However, here's one where i have not found any
example code..
i am trying to run a window as a sheet (for the eventual purpose of
using it for some data entry, a task beyond that of simply having the
user click one of maybe three buttons) and have successfully been able
to run the sheet. however, i can not seem to make it go away. i have
designed a window in IB which currently has only a bit of text and a
button. i can connect the button to an action method in my window
controller and have it do anything i want. my question is, how do i make
didEndSelector work? where does it come from? obviously i need a button
which tells the sheet to end, but i'm lost as to how. how do i tell the
sheet when to end? is there a connection i need to make in IB?
i have tried connecting my sole button to a action method and having
this message in the method
[NSApp endSheet:myWindowSheet];
but nothing happens.
my use of the beginSheet method is this:
[NSApp beginSheet:[self myWindowSheet]
modalForWindow:[self window]
modalDelegate:self
didEndSelector:@selector(theEnd:)
contextInfo:NULL];
i've also tried declaring a method named endSheet: and placing that in
the didEndSelector, but to no avail.
thank you for any help you can provide.
Jason Moore