Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b66910a704
Fetching contributors…

Cannot retrieve contributors at this time

54 lines (38 sloc) 0.775 kb
//
// CXMenuButton.m
//
// Created by Chris Thomas on 2006-10-09.
// Copyright 2006 Chris Thomas. All rights reserved.
// MIT license.
//
#import "CXMenuButton.h"
@implementation CXMenuButton
// Initialization
- (void) commonInit
{
// Use alternateImage for pressed state
[[self cell] setHighlightsBy:NSCellLightsByContents];
}
- (void) awakeFromNib
{
[self commonInit];
}
// Events
- (void) mouseDown:(NSEvent *)event
{
[self highlight:YES];
[NSMenu popUpContextMenu:menu withEvent:event forView:self withFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
[self highlight:NO];
}
// Accessors
- (NSMenu *)menu
{
return menu;
}
- (void)setMenu:(NSMenu *)aValue
{
NSMenu *oldMenu = menu;
menu = [aValue retain];
[oldMenu release];
}
@end
Jump to Line
Something went wrong with that request. Please try again.