Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa sheet

Cocoa sheet
Thread Tools
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Jul 27, 2004, 10:12 PM
 
Ok, I feel like a complete and utter retard asking this, but I've tried everything, and Juan has my Cocoa books, so...

I'm trying to attach a sheet to my window. I want it to slide down on launch. so I have:
Code:
- (void)awakeFromNib { [NSApp beginSheet: loginSheet modalForWindow: mainWindow modalDelegate: self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:nil]; }
when I run the app, the window appears and the sheet appears... but it's not attached and it's definately NOT modal to the window. This is bad.

I was under the impression that "modalForWindow: mainWindow" is all that's required to attach a sheet to a window, but it seems this is not the case. Anyone know what I'm missing?
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
Mac Enthusiast
Join Date: Nov 2001
Status: Offline
Reply With Quote
Jul 28, 2004, 03:01 AM
 
Try sending mainWindow a makeKeyAndOrderFront: message before you run the sheet.
     
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Jul 28, 2004, 04:03 AM
 
cool, except it seems to break cmd-Q quitting it... odd.
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Jul 28, 2004, 01:04 PM
 
I don't think you can normally quit while an alert panel is up.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Apr 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
Jul 28, 2004, 02:00 PM
 
guess I should hook up the cancel button then
The short shall inherit the earth. Just you wait. You won't see us coming. We'll pop out from under tables, beds, and closets in hordes. So you're tall, huh? You won't be so tall when I chew off your ankles. Mofo
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:06 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2