IPhoto-Like Toolstrips
IPhoto-Like Toolstrips
- Subject: IPhoto-Like Toolstrips
- From: Chris Blunt <email@hidden>
- Date: Fri, 4 Aug 2006 00:53:01 +0100
Hi,
(Apologies for cross-post)
I'm trying to create a button strip / toolbar like that use in the
latest iPhoto versions (underneath the photos) for my app. A little
research has hinted that overriding the NSToolbar would be unsuitable.
I have opted to create an NSView and attach a series of custom
NSButton classes to that view. All is working, except that when
clicked, the button draws a thick grey line along its bottom edge
that also stays drawn when the button is released.
I have set the border and bezel types to (what I think) are 'do
nothing', but can't seem to get rid of this line. Could anyone point
out where I'm going wrong?
Code for my custom button is:
------------------------------------
// MyToolstripButton.m
//
- (id)initWithFrame:(NSRect)frameRect
{
if( self = [super initWithFrame:frameRect] )
{
[self setBordered:NO];
[self setImagePosition:NSImageAbove];
// Setup the strip button's action cell
[[self cell] setBezelStyle:NSShadowlessSquareBezelStyle];
[[self cell] setHighlightsBy:NSNoCellMask];
[[self cell] setFont:[NSFont systemFontOfSize:10.0]];
}
return self;
}
//
// Method to create a MyToolstripButton and attach it to given NSView
- (MyToolstripButton *)toolstripButtonInView:(NSView *)aView
frame:(NSRect)aFrame
state:(BOOL)state
continuous:(BOOL)continuous
image:(NSImage *)image
title:(NSString *)title
{
MyToolstripButton *button = [[MyToolstripButton alloc] aFrame];
// Setup the button
[button setContinuous:continuous];
[button setState:state];
[button setImage:image];
[button setTitle:title];
// Add stripbutton to view
[aView addSubview:button];
[button release];
// Return the newly created button
return button;
}
------------------------------------
Thanks,
Chris
--
www.chrisblunt.com
_______________________________________________
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