Toolbar in a Sheet?
Toolbar in a Sheet?
- Subject: Toolbar in a Sheet?
- From: Matt Ball <email@hidden>
- Date: Mon, 24 May 2004 23:32:41 -0400
I want to put a toolbar in a sheet (ala iMovie's "share" sheet,
although iMovie uses a fake toolbar). Everything works fine, except the
sheet is drawn about 20 pixels below where it should be. Apparently,
because of the toolbar, transparent space is being drawn where the
titlebar should be. I've experimented and so far, I've come up with
this, which is in my MyDocument.m file:
- (NSRect)window:(NSWindow *)window willPositionSheet:(NSWindow *)sheet
usingRect:(NSRect)rect {
if([[sheet title] isEqualTo: @"Shape"])
{
NSRect windowFrame = [mainWindow frame];
int halfOfWidth = windowFrame.size.width/2;
NSRect fieldRect = NSMakeRect(windowFrame.size.width - halfOfWidth,
windowFrame.size.height, 0, 0);
return fieldRect;
}
}
This works except for a few minor problems. First, the sheet appears
(using a genie effect) from the top center of the titlebar instead of
the bottom center of it. After it is animated, the sheet is in the
right place, but during the animation, it originates from the wrong
place. Secondly, during the animation, shadows are drawn on the edges
of the transparent space where the titlebar should be. The shadows
disappear as soon as the sheet finishes animating.
Does anyone have any ideas on how I might:
1) Force the sheet to slide down instead of using the genie effect (the
sheet IS smaller than the window, so it should slide)
2) Make the sheet originate from the correct position
3) Get rid of the nonexistent titlebar's shadows during the animation
Thanks in advance,
-- Matt Ball
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.