On Jul 10, 2008, at 11:33 AM, Seth Willits wrote:
Has anyone created a custom window like the event info editor in iCal in 10.5? There's a few things I'm not sure how to do:

1) Drawing the window background gradient is pretty straightforward, but creating the thin border on the window is not. I'm concerned about not being getting it "thin" enough. Any tips on that?

Don't know but it appears a thin border is added to the content view automatically - at least that is what I see in my own version.

2) The zoom-in effect. I'm going to go out on a limb here and say that this is probably done using private methods. The only public way I can think of to do it would be to grab an image of my window using the CGWindow API while the window is still hidden, then scale that in an overlay window for the effect.


On 10.5 this is probably done with an animation. The following is basically what I'm using in a custom window class (you can set startFrom to something suitable for your zoom start position):

- (void)showWindowUsingZoomin:(NSRect)targetRect
{
 NSRect startFrom = NSZeroRect;  // <- size component should be {0,0}
 CGFloat duration = 1.0; // <- make much less in real life like 0.1

 [self setFrame:startFrom display:NO];
 [self makeKeyAndOrderFront:nil];

 [NSAnimationContext beginGrouping];
 [[NSAnimationContext currentContext] setDuration:duration];

 [[self animator] setFrame:targetRect display:YES];

 [NSAnimationContext endGrouping];
}

Be warned that since startFrom.size is {0,0} this causes trouble with controls that auto-size based on the window's size.

Regards
Markus
--
__________________________________________
Markus Spoettl

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to