Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicating the cosmetics of the System Preferences Panel



You can use NSWindow's setFrame:display:animate: To set the frame to
something new and do it with animation. Then, you can have preferences
setup as individual views that can be attached to the window. Coupling
those together gives you a similar affect. You can also use NSToolbar
for one toolbar. In order to get the tiered effect, you could make a
custom table that handles view objects in each row.

For example, to attach a view and resize, you could add a method like
this to NSWindowController:

- (void) attachView: (NSView*)view display: (BOOL)display animate:
(BOOL)animate
{
NSWindow* window = [self window];

float toolbarSize = [window frame].size.height - [[window
contentView] frame].size.height;
NSRect frame = [window frame];
NSSize frameSize = [view frame].size;
frame.origin.y += frame.size.height - frameSize.height -
toolbarSize;
frame.size = frameSize;
frame.size.height += toolbarSize;

[window setContentView: view];
[window setFrame: frame display: display animate: animate];
}

Then, given a view that you want displayed, you could call:

[windowController attachView: view display: YES animate: YES];

On 31 Jan 2004, at 5:34 PM, Lotsa Cabo wrote:

> Could someone tell me how they accomplished building the System
> Preferences dialog? Maybe what controls were used? How the resizing
> effect happens (if it's automatically or manually coded)? Ya' know,
> that kinda stuff.
_______________________________________________
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.

References: 
 >Duplicating the cosmetics of the System Preferences Panel (From: Lotsa Cabo <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.