#188 ✓resolved
Tim Henrion

CPButton fires actions and draws alternateImage when disabled

Reported by Tim Henrion | December 30th, 2008 @ 08:23 AM

Created a button with the following code and slapped it in a view:


        _forwardButton = [[CPButton alloc] initWithFrame:CGRectMake( 22, 0, 22, 20 )];
        [_forwardButton setBordered:NO];
        [_forwardButton setImage:__forwardButton];
        [_forwardButton setAlternateImage:__forwardButtonHighlighted];
        [_forwardButton setImagePosition:CPImageOnly];
        [_forwardButton setEnabled:NO];
        [_forwardButton setTarget:self];
        [_forwardButton setAction:@selector(_forwardClicked:)];
        [_forwardButton sendActionOn:CPLeftMouseUpMask];

Notice that the button is disabled with setEnabled:NO. When I fire up my app, the button image appears to have been dimmed (looks like 0.5 alpha) but it is still clickable (it draws the alternateImage on mouse down) and fires its configured action on mouse up.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Cappuccino Web Framework, including AppKit, Foundation, and Objective-J.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages