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 : sheets in Java

Cocoa : sheets in Java
Thread Tools
Fresh-Faced Recruit
Join Date: Apr 2001
Location: Paris, France
Status: Offline
Reply With Quote
Apr 2, 2001, 03:56 PM
 
Hi,
First, I want to apologize : I know such subjects have already been posted, but I still don't understand a thing

I have two windows in a Java/Cocoa project. Let's call the fist "mainWindow" and the second "sheetWindow". I would like the second one to appear as a sheet on the first as a button is clicked.

Can someone explain me how to do this in Java? The Apple's documentation is very poor on this subject.

Thanks a lot for your help,
A poor newbie in OS X programming
     
Mac Elite
Join Date: Sep 2000
Location: Eagan, MN
Status: Offline
Reply With Quote
Apr 2, 2001, 10:09 PM
 
In Objective-C, I did it with the following:

[NSApp beginSheet:sheetWindow modalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(sheetDone:returnCode:cont extInfo) contextInfo(void *)0];

Which causes you to need a delegate function like:
- (void)sheetDone NSWindow *)sheet returnCode int)returnCode contextInfo void *)contextInfo
{
}

Sorry that it's the wrong language. But I hope it helps anyways.

------------------


[This message has been edited by mr_sonicblue (edited 04-02-2001).]
     
Fresh-Faced Recruit
Join Date: Apr 2001
Location: Paris, France
Status: Offline
Reply With Quote
Apr 3, 2001, 05:50 PM
 
OK, here is the solution I found:

To make the sheet appear:
NSApplication.sharedApplication().beginSheet (sheetWindow,mainWindow,null,null,null);

To make it disappear:
NSApplication.sharedApplication().endSheet(sheetWi ndow);
sheetWindow.close();

Thanks for your help,
Thierry
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
Apr 25, 2001, 03:58 PM
 
I have a related question: How do I make windows with a little arrow in them that expands the window when you click on it? (Like, for instance, the copy dialog in the Finder.) This seems to be a standard way to hide more advanced or detailed information.

If this isn't a Cocoa thing, then I'll try using a tab view or a pull-down sheet.

[This message has been edited by tie (edited 04-25-2001).]
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
   
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 02:52 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