• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Disabled button looks like enabled
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disabled button looks like enabled


  • Subject: Re: Disabled button looks like enabled
  • From: Andy Lee <email@hidden>
  • Date: Mon, 12 Jan 2009 14:08:30 -0500

But it will still visually respond to mouse clicks, which is not desired, in my interpretation of the problem statement. [[theButton cell] setHighlightsBy:NSNoCellMask] presumably takes care of that -- but then the user might still be able to select the button by tabbing to it.

If a single NSButton is used, I think the easiest thing is to disable it and then override its drawing behavior, as I. Savant suggested. But it depends on the context of what the application is trying to do. If the application displays a screenful of different fake UI components (for example, as a sort of "mockup," as I.S. posited), it would be impractical to have a subclass for every control/cell. In that case, some sort of offscreen drawing makes sense -- draw the whole window/view offscreen, not even bothering to disable the controls, and blit it to the real window.

--Andy

On Jan 12, 2009, at 1:35 PM, Dave DeLong wrote:

So what you're saying is you want a button that doesn't do anything? In that case, just don't hook the button's action up to anything...

Dave

Sent from my iPod

On Jan 12, 2009, at 11:32 AM, Donnie Lee <email@hidden> wrote:

That's not better than my way. I never need to handle events from this button.

On Mon, Jan 12, 2009 at 9:28 PM, Dave DeLong <email@hidden> wrote:
Then simply subclass NSButton, add an ivar called fakeEnabled, then override
the mouseDown and mouseUp events to do the following:
...
Do the same for mouseUp, and just have a getter and setter for fakeEnabled.
VoilĂ : a button that always looks enabled but can be set to respond only
part of the time.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Disabled button looks like enabled
      • From: "Donnie Lee" <email@hidden>
    • Re: Disabled button looks like enabled
      • From: Dave DeLong <email@hidden>
References: 
 >Disabled button looks like enabled (From: "Donnie Lee" <email@hidden>)
 >Re: Disabled button looks like enabled (From: Ricky Sharp <email@hidden>)
 >Re: Disabled button looks like enabled (From: Luca <email@hidden>)
 >Re: Disabled button looks like enabled (From: "Donnie Lee" <email@hidden>)
 >Re: Disabled button looks like enabled (From: "I. Savant" <email@hidden>)
 >Re: Disabled button looks like enabled (From: "Donnie Lee" <email@hidden>)
 >Re: Disabled button looks like enabled (From: Andy Lee <email@hidden>)
 >Re: Disabled button looks like enabled (From: "Donnie Lee" <email@hidden>)
 >Re: Disabled button looks like enabled (From: Dave DeLong <email@hidden>)
 >Re: Disabled button looks like enabled (From: "Donnie Lee" <email@hidden>)
 >Re: Disabled button looks like enabled (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Disabled button looks like enabled
  • Next by Date: Re: Need help on nsfontmanager.
  • Previous by thread: Re: Disabled button looks like enabled
  • Next by thread: Re: Disabled button looks like enabled
  • Index(es):
    • Date
    • Thread