Re: Special Borders
Re: Special Borders
- Subject: Re: Special Borders
- From: Ryan Stevens <email@hidden>
- Date: Mon, 18 Jul 2005 12:01:30 -0700
You might search cocoadev, I know there's some sample code there that
does this.
On Jul 18, 2005, at 10:13 AM, Ben Kazez wrote:
I'm also working on trying to create the bevelled border that iApps
use around their table views.
I noticed in iPhoto's nib file that it uses an NSTableView subclass
for each of the table views that have the bevelled border, which
makes a lot of sense: No need to require a subview when this is
just a specific type of table. The only disadvantage is that then
you need subclasses for all UI elements that need to have this
bevelled border, but I'm not convinced that that's so bad -- there
aren't that many anyway.
Unfortunately I'm very new to Cocoa, but is there a way of doing
the following in the drawRect method for an NSTableView subclass
(say, BKBevelledTableView)?
// psuedocode, of course
- drawRect:(NSRect)rect {
[self drawBevelledEdge]; // creates bevelled border
[self setAvailableDrawingArea:
([self availableDrawingArea] - (1 pixel on all sides))];
[super drawRect]; // draws table view but 1 pixel smaller on
all sides
[self restoreAvailableDrawingArea];
}
I'm not sure if my "availableDrawingArea" concept is the same as
NSView's "bounds" concept or if my availableDrawingArea concept
even exists at all. Can someone help?
Ben
On Mon, 18 Jul 2005 07:32:49 -0700, John C. Randolph wrote:
In creating our projects UI we noticed that certain iApps
(iTunes, iPhoto, etc...) have a different border-type around the
interface elements. For example the border around any of the
box's in iTunes like the Now Playing album artwork box is
different then any border- type you can give to a NSBox or other
views. We also noticed some 3rd party apps like Delicious
Library seem to use this border-type as well. We want to join in
the club ;-)
This border has no corner pixel, a darker grey on top, a light
almost white grey on the bottom and, the left and right has a
medium grey. Inside this is a solid darker grey. Its like a
simple 1px shadow is being cast around the view.
( Our artist's representation of how this border looks: http://
cole.nitroy.com/Files/Temp/specialBorder.jpg )
The only way I can see to implement this in our app would be to
make a containing NSBox and have manually draw this border.
Is there a simple easy way of doing this and I am
overcomplicating things? I have scoured all over IB, and the
NSView documentation and cannot find anything. I have pried
around in the nib files of some of the iApps and do not see any
red flags.
Apple doesn't provide any public way to draw those borders. If I
were in your shoes, I'd just draw it using NSRectFillListWithGrays();
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden