Re: How to make a view subclass like dashcodes "Widget Attribute" pannel
Re: How to make a view subclass like dashcodes "Widget Attribute" pannel
- Subject: Re: How to make a view subclass like dashcodes "Widget Attribute" pannel
- From: "Alan Smith" <email@hidden>
- Date: Sun, 1 Jul 2007 14:29:23 -0400
Tim,
It would be simple enough to do something like the "Widget Attributes"
panel with custom NSBoxes. Override - [NSBox drawRect:] and then have
an accessor to get/set weather it should be dark gray or not.
- (void)drawRect:(NSRect)rect
{
rect = [self bounds];
NSColor *backgroundColor = nil;
if (_isDarkGray == YES)
{
backgroundColor = [NSColor darkGrayColor];
}
else
{
backgroundColor = [NSColor grayColor];
}
[backgroundColor set];
NSRectFill(rect);
// Draw pretty box title...
}
Something like that should do it, you'd need to add code to draw the
title though. I think there is a method that is something like -
(NSRect)titleRectForBounds:(NSRect)bounds, it should give you the rect
to draw the title in.
Then fill a window with NSBoxes and set them all to use your subclass of NSBox.
Let me know if you have anymore questions about this, I'd be happy to help.
Peace, Alan
--
// Quotes from Alan Smith -------------------------
"You don't forget, you just don't remember."
"Maturity resides in the mind."
"Silence is the Universe's greatest gift."
"When the World realizes that personal beliefs are not something to
argue or fight over, it shall evolve."
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden