Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

CPButton fires actions and draws alternateImage when disabled

#188

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.

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

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. ronin-756 (at lighthouseapp)
    ronin-756 (at lighthouseapp)

    A patch has been proposed and submitted to the dev mailing-list : http://github.com/suitmymind/cap...

    January 6th, 2009 @ 09:35 AM

  2. ronin-756 (at lighthouseapp)
  3. admin (at 280north)
    admin (at 280north)
    • State changed from new to resolved

    (from [8de321c780305fc6dac1d266f6f008038bf29244]) Final fix for buttons not working when disabled.

    [#188 CPButton fires actions and draws alternateImage when disabled state:resolved]

    Reviewed by me. http://github.com/280north/cappu...

    January 21st, 2009 @ 09:47 AM

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.