Re: Disabled button looks like enabled

2009-01-12 Thread Ricky Sharp
Do not do this. Users will be very frustrated when they cannot  
interact with that button.


Why do you think you need this?

Sent from my iPhone

On Jan 12, 2009, at 5:55 AM, Donnie Lee lpr...@gmail.com wrote:


Hi!

I'd like to create a disabled button that looks like enabled. If I
just set enabled to no, I got grayed button. Instead I do
[[theButton cell] setHighlightsBy:NSNoCellMask]; and it looks like
disabled but continues to receive events. Is there a way to make a
disabled button that looks like enabled? Thanks in advance!

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rsharp%40mac.com

This email sent to rsh...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Luca

I agree with Ricky. Why do you need this?
By the way, think the better way is to subclass the NSButton,  
overriding the -mouseDown method. Do not call -[super mouseDown:], and  
it's done - your button will not be drawed.


-- Luca C.

On 12 Jan 09, at 13:46, Ricky Sharp wrote:

Do not do this. Users will be very frustrated when they cannot  
interact with that button.


Why do you think you need this?

Sent from my iPhone

On Jan 12, 2009, at 5:55 AM, Donnie Lee lpr...@gmail.com wrote:


Hi!

I'd like to create a disabled button that looks like enabled. If I
just set enabled to no, I got grayed button. Instead I do
[[theButton cell] setHighlightsBy:NSNoCellMask]; and it looks like
disabled but continues to receive events. Is there a way to make a
disabled button that looks like enabled? Thanks in advance!

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rsharp%40mac.com

This email sent to rsh...@mac.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/luca.pazzerello%40gmail.com

This email sent to luca.pazzere...@gmail.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
I again forgot that reply button reply to sender not to the list,
crazy lists.apple.com! Here is my answer to Ricky:

The button should be disabled by design. It don't intend to interact
with a user at all.

Cocoa Developers cocoa-dev@lists.apple.com

On Mon, Jan 12, 2009 at 7:34 PM, Luca luca.pazzere...@gmail.com wrote:
 I agree with Ricky. Why do you need this?
 By the way, think the better way is to subclass the NSButton, overriding the
 -mouseDown method. Do not call -[super mouseDown:], and it's done - your
 button will not be drawed.

 -- Luca C.

 On 12 Jan 09, at 13:46, Ricky Sharp wrote:

 Do not do this. Users will be very frustrated when they cannot interact
 with that button.

 Why do you think you need this?

 Sent from my iPhone

 On Jan 12, 2009, at 5:55 AM, Donnie Lee lpr...@gmail.com wrote:

 Hi!

 I'd like to create a disabled button that looks like enabled. If I
 just set enabled to no, I got grayed button. Instead I do
 [[theButton cell] setHighlightsBy:NSNoCellMask]; and it looks like
 disabled but continues to receive events. Is there a way to make a
 disabled button that looks like enabled? Thanks in advance!

 Donnie.
 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/rsharp%40mac.com

 This email sent to rsh...@mac.com

 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:

 http://lists.apple.com/mailman/options/cocoa-dev/luca.pazzerello%40gmail.com

 This email sent to luca.pazzere...@gmail.com


 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/lprpro%40gmail.com

 This email sent to lpr...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 12:10 PM, Donnie Lee lpr...@gmail.com wrote:
 I again forgot that reply button reply to sender not to the list,
 crazy lists.apple.com! Here is my answer to Ricky:

 The button should be disabled by design. It don't intend to interact
 with a user at all.

  This is exactly the point Ricky was making. If a button never works
*by design*, a button is the wrong choice for a UI element ... unless,
of course, you're creating some sort of UI mockup generator app or
something similar that merely draws representations of OS X UI
elements. Then again, it wouldn't matter whether the button does
anything or not since it'd not be clickable anyway.

  To answer your question, though, you'd need to override the button's
drawing to always draw the enabled state, ignoring the control's
actual state. Or, you could let the button allow clicking and simply
do nothing. Then it wouldn't appear as broken as if it appeared
enabled and didn't even accept a click.

  The thing to consider is that a user encountering such a control
will assume your application is buggy because it doesn't behave
properly. If you explain what your *goal* is (as you've been asked to
twice already), maybe the community can suggest a much better approach
you hadn't considered.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 The button should be disabled by design. It don't intend to interact
 with a user at all.

  This is exactly the point Ricky was making. If a button never works
 *by design*, a button is the wrong choice for a UI element

I don't like to discuss ideological part of the thing, I ask only
about a technical implementation.

  you'd need to override the button's
 drawing to always draw the enabled state, ignoring the control's
 actual state.

Too dirty solution.

 Or, you could let the button allow clicking and simply
 do nothing.

As I already did and asked about more beautiful ways. If there is no
more beautiful way -- not a big problem.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 12:57 PM, Donnie Lee lpr...@gmail.com wrote:

  you'd need to override the button's
 drawing to always draw the enabled state, ignoring the control's
 actual state.

 Too dirty solution.


  :-D  That's immensely entertaining.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee

On Jan 12, 2009, at 12:57 PM, Donnie Lee wrote:
The button should be disabled by design. It don't intend to  
interact

with a user at all.


This is exactly the point Ricky was making. If a button never works
*by design*, a button is the wrong choice for a UI element


I don't like to discuss ideological part of the thing, I ask only
about a technical implementation.


you'd need to override the button's
drawing to always draw the enabled state, ignoring the control's
actual state.


Too dirty solution.


What's dirty about it?  Note that as soon as you call a solution  
dirty you're dangerously close to discussing ideology.


You defined the problem as wanting a button that is disabled but looks  
enabled.  You yourself said you want the button to draw as if it were  
enabled despite the fact that it is disabled.  The above solution  
basically echoes your exact requirements, so if it is dirty, then your  
application design must also be dirty.  Why is it not dirty to present  
a button whose appearance is a lie?


As others have already asked: what are you trying to accomplish?  What  
is the usage scenario you are trying to achieve, and what is its  
purpose?


If you want a better answer (and there may not be one), you need to  
provide more context.


--Andy






Or, you could let the button allow clicking and simply
do nothing.


As I already did and asked about more beautiful ways. If there is no
more beautiful way -- not a big problem.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 As others have already asked: what are you trying to accomplish?

I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
Then simply subclass NSButton, add an ivar called fakeEnabled, then  
override the mouseDown and mouseUp events to do the following:


-(void)mouseDown:(NSEvent*)event{
  if (fakeEnabled==NO){
[super mouseDown:event];
  }
}

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.


Dave

Sent from my iPod

On Jan 12, 2009, at 11:20 AM, Donnie Lee lpr...@gmail.com wrote:


As others have already asked: what are you trying to accomplish?


I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com

This email sent to davedel...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Randall Meadows

On Jan 12, 2009, at 11:20 AM, Donnie Lee wrote:


As others have already asked: what are you trying to accomplish?


I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!


Because, frankly, that doesn't make any sense (to put it nicely), and  
they're asking WHY you want to do that in anticipation of giving you a  
better solution.


They've given you a great answer, which you've rebuffed, and now  
you're scolding them for *continuing* to try to help you.  Not exactly  
the Dale Carnegie method...

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
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 davedel...@me.com 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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Maybe people ask because they're trying to help?

Maybe you will first think your head before ask your questions? Your
questions CAN'T help to solve my problem, so please don't flood in
list.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 1:20 PM, Donnie Lee lpr...@gmail.com wrote:

 I try to create a disabled button that looks like enabled button
 :))) It's so easy to understand, why do you ask more more and
 more???!!!

  Seriously?

  A solution has already been handed to you - one which you rejected
because it doesn't meet with your own ideals - that will do exactly as
you asked. Professionals with a long history of providing good
guidance on this list are asking this question repeatedly because what
you are doing has a 95% chance of being completely and utterly
bone-headed, though everybody who responded was heretofore careful to
word that point gently*. Your response to this concern, however, seems
to include an insult (so easy to understand).

  Surely you didn't intend to insult those who helped you, so it's
probably best to either graciously accept the suggested solution
(which seems 'dirty' because you're working hard to purposefully break
an interactive control) and leave the conversation at that OR you
could try actively participating in the discussion, rather than
demanding that others serve you on your terms or shut up.

  Just a thought.

--
I.S.


* Though patience is a virtue, it is in limited supply. First come,
first served. Limit one serving per thread.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
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 lpr...@gmail.com 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 davedel...@me.com  
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 respon 
d only

part of the time.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com

This email sent to davedel...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Disabled button looks like enabled

2009-01-12 Thread Jon C. Munson II
Why not just create a picture of an enabled button (say, a JPG) and display
that?  If you need text, you can create a blank button and put a label
over it which you can then change...etc...

If you don't need a button in the traditional sense, why carry all that
overhead with you in the app?

BTW, the accomplishment question was asked in the general sense, not the
specific sense.  That way the gurus can possibly provide you with a better
way.

Peace, Love, and Light,

/s/ Jon C. Munson II

-Original Message-
From: cocoa-dev-bounces+jmunson=his@lists.apple.com
[mailto:cocoa-dev-bounces+jmunson=his@lists.apple.com] On Behalf Of
Donnie Lee
Sent: Monday, January 12, 2009 1:21 PM
To: Cocoa Developers
Subject: Re: Disabled button looks like enabled

 As others have already asked: what are you trying to accomplish?

I try to create a disabled button that looks like enabled button
:))) It's so easy to understand, why do you ask more more and
more???!!!

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com

This email sent to jmun...@his.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 1:34 PM, Donnie Lee lpr...@gmail.com wrote:

 That's not better than my way.
...
 Maybe you will first think your head before ask your questions? Your
 questions CAN'T help to solve my problem, so please don't flood in
 list.


 Ugh ... READ:   http://www.slash7.com/pages/vampires


--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee

On Jan 12, 2009, at 1:34 PM, Donnie Lee wrote:

Maybe people ask because they're trying to help?


Maybe you will first think your head before ask your questions? Your
questions CAN'T help to solve my problem, so please don't flood in
list.


Please don't reply to me on the list when I've specifically said I was  
replying off-list.


Are you just trolling?  Because here you are flooding the list when I  
replied off-list.


--Andy

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 1:20 PM, Donnie Lee lpr...@gmail.com wrote:
 As others have already asked: what are you trying to accomplish?

 I try to create a disabled button that looks like enabled button
 :))) It's so easy to understand, why do you ask more more and
 more???!!!

Because, to be blunt, it appears that you're trying to do something
stupid, and the people on this list are trying to help you find a
better way to do whatever it is that you're trying to do.

Analogy: someone writes to a carpenter group complaining that they're
having trouble driving nails with their forehead. Of course the
carpenters are aghast. Half of them say, use a hammer! The other
half ask, why are you trying to drive nails with your forehead?

You're trying to drive nails with your forehead. Of course people are
going to ask why. If you want to have a productive discussion, simply
explain why you insist on driving them with your forehead instead of
with a hammer. If you have a good reason that nobody thought of,
everybody will go home happy. If, as seems much more likely, you don't
actually have a good reason, then we can explain to you the error of
your ways and then everybody will go home happy.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 So what you're saying is you want a button that doesn't do anything?

Exactly.

 In that case, just don't hook the button's action up to anything...

Already did it, just tried to remove this button from system observers
to save system resources putting it in disabled state.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
You read too much Tolkien. It's hard to me to trace which messages
sent to list and which is not because crazy lists.apple.com software
didn't provide reply-to field and I enter to address manually.

PS: Now only reply to all button.

On Mon, Jan 12, 2009 at 9:45 PM, Andy Lee ag...@mac.com wrote:
 On Jan 12, 2009, at 1:34 PM, Donnie Lee wrote:

 Maybe people ask because they're trying to help?

 Maybe you will first think your head before ask your questions? Your
 questions CAN'T help to solve my problem, so please don't flood in
 list.

 Please don't reply to me on the list when I've specifically said I was
 replying off-list.

 Are you just trolling?  Because here you are flooding the list when I
 replied off-list.

 --Andy


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Because, to be blunt, it appears that you're trying to do something
 stupid, and the people on this list are trying to help you find a
 better way to do whatever it is that you're trying to do.

The main problem that people think that I try something stupid.
Instead of technical discussion they try to teach me what should I do
and how should I do it. Like a religious zombies, seriously.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Robert Marini
More often than not, optimizing a user's experience should be the  
larger concern than worrying about an NSButton's memory footprint.


-rob.

On Jan 12, 2009, at 1:43 PM, Donnie Lee wrote:


So what you're saying is you want a button that doesn't do anything?


Exactly.


In that case, just don't hook the button's action up to anything...


Already did it, just tried to remove this button from system observers
to save system resources putting it in disabled state.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee
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 lpr...@gmail.com 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 davedel...@me.com  
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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/davedelong%40me.com

This email sent to davedel...@me.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 18:54:19, Donnie Lee wrote:


You read too much Tolkien. It's hard to me to trace which messages
sent to list and which is not because crazy lists.apple.com software
didn't provide reply-to field and I enter to address manually.

PS: Now only reply to all button.


Ever heard of Rules?

Any recipient contains: cocoa-dev@lists.apple.com

Move message to mailbox: Cocoa Dev

Simple, eh?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Robert Marini
There is a reason *why* disabled buttons have a different appearance.   
The members of this list are curious as to why you would want to  
override that. And yes, if you don't have a good reason they will  
certainly point that out.


-rob.

On Jan 12, 2009, at 1:57 PM, Donnie Lee wrote:


Because, to be blunt, it appears that you're trying to do something
stupid, and the people on this list are trying to help you find a
better way to do whatever it is that you're trying to do.


The main problem that people think that I try something stupid.
Instead of technical discussion they try to teach me what should I do
and how should I do it. Like a religious zombies, seriously.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rob%40pinchmedia.com

This email sent to r...@pinchmedia.com




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Disabled button looks like enabled

2009-01-12 Thread Jean-Daniel Dupas


Le 12 janv. 09 à 20:24, Donnie Lee a écrit :

I am curious to know more about theses system observers. Can you  
explain

us what is it ?


Cocoa observers which sends mouse events, keyboard events etc.



Hardware event are received by the kernel that send them to the window  
server that forward them to the active application.
Then NSApplication receive them and send them to the key window (or  
the target window which is not always the key window for mouse events).

Then the window object try to resolve the target responder.

Each NSView is a responder. I really don't understand how you're  
trying to reduce system resource usage.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 There is a reason *why* disabled buttons have a different appearance.  The
 members of this list are curious as to why you would want to override that.
 And yes, if you don't have a good reason they will certainly point that out.

I see there is unavoidable problem with my fake button and
Accessibility tools which may happens. I planned to use it to emulate
gradient bottom bar (under Source List control), looks like in
Mail.app. I created three buttons, two gradient action-buttons and one
gradient non-clickable button with image aligned to right. This image
is a three lines which act as
additionalEffectiveRectOfDividerAtIndex: of NSSplitView. It looks
really nice but the fact that is a button...can it hurt people with
Accessibility devices?

Really, I don't like all these additional libraries that try to
emulate gradient bottom bar, because they redraw these controls by
itself, and I would like to use only Apple controls.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Then the window object try to resolve the target responder.

 Each NSView is a responder. I really don't understand how you're trying to
 reduce system resource usage.

Hmm, I don't know internals of Cocoa, I hypothesized that putting a
button in a disabled state can remove focus areas handled by mouse or
something else, which can save a little system resources without big
pain. Are you 100% sure that disabled and enabled buttons takes
identical amount of system resources?

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 2:24 PM, Donnie Lee lpr...@gmail.com wrote:
 I am curious to know more about theses system observers. Can you explain
 us what is it ?

 Cocoa observers which sends mouse events, keyboard events etc.

  You should probably read this:

http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_2.html#

  ... you appear to be misunderstanding how events are handled.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
I'll also point out that this will work for any NSButton flavor  
(checkboxes, help, recessed, etc).  I just did some further testing to  
make sure that these buttons refuse the focus, and they definitely  
don't accept being first responder.  I created an interface with a  
bunch of normal buttons, wired up the nextKeyView to be sequential,  
and then wired the last of the normal buttons to the first of the  
FakeButtons.  (I also wired the first normal button to be  
initialFirstResponder).  I turned on full access in SysPrefs, then ran  
the app.


Hitting the tab button will ONLY tab through the normal buttons.  Even  
though one of the FakeButtons is wired to be the nextKeyView, since it  
refuses first responder, it just jumps to the next thing that does  
accept first responder (this being one of the normal buttons).


If that doesn't do what he's asking for, then I have no clue what will.

Dave

On Jan 12, 2009, at 12:18 PM, Dave DeLong wrote:

Aha, I see what you're saying.  Well, I just played around with  
this, and subclassing an NSButton as follows will create a button  
that looks enabled but won't respond to mouse clicks and also won't  
allow users to tab to the button (ie, disallows the focus):


@interface FakeButton : NSButton { }
@end

@implementation FakeButton

- (BOOL) acceptsFirstReponder { return NO; }

- (BOOL) becomeFirstResponder { return NO; }

- (void) mouseDown:(NSEvent *)event { return; }

- (void) mouseUp:(NSEvent *)event { return ; }

@end

Just tried it and it works as I've described above.

Dave

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 2:39 PM, Donnie Lee lpr...@gmail.com wrote:
 I planned to use it to emulate
 gradient bottom bar (under Source List control), looks like in
 Mail.app.

  Is THAT all?!  :-D

  In an attempt to avoid using your own (or third-party) code that
very specifically and efficiently addresses the problem (because of
some strange phobia), you're making things so much more difficult than
is even remotely necessary or sane!

  If you're worried about consuming resources, consider the resources
involved in using a full-blown control versus a simple, pointed custom
view that draws a gradient. Seriously, your worries are akin to
holding your breath because you're afraid of inhaling something bad
that may or may not be there.

  BREATHE!!!

  Then create a custom NSView that draws a gradient using the
*INCREDIBLY EFFICIENT* system calls. Perhaps NSGradient if you're
requiring 10.5 or above? Maybe CTGradient (the slimmed down version
someone posted somewhere googlable if you're cruft-phobic)?

  This is infinitely better than
super-premature-as-in-before-the-creation-of-the-universe
optimization.

 Really, I don't like all these additional libraries that try to
 emulate gradient bottom bar, because they redraw these controls by
 itself, and I would like to use only Apple controls.

  Get over it.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 2:44 PM, Donnie Lee lpr...@gmail.com wrote:

 Are you 100% sure that disabled and enabled buttons takes
 identical amount of system resources?

 YES.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Michael Ash
On Mon, Jan 12, 2009 at 1:43 PM, Donnie Lee lpr...@gmail.com wrote:
 So what you're saying is you want a button that doesn't do anything?

 Exactly.

 In that case, just don't hook the button's action up to anything...

 Already did it, just tried to remove this button from system observers
 to save system resources putting it in disabled state.

See, this is why you should tell people what you're trying to do when
they ask you, or better yet, up front.

Imagine how the thread might have gone if you had put this information
in your original e-mail:

Is there a way to make a disabled button that looks like enabled? I'm
trying to remove this button from system observers to save system
resources putting it in disabled state.

Well, that doesn't make any sense. There's no such thing as 'system
observers', and a disabled button takes up exactly the same system
resources as an enabled button.

Oh, I see, thanks.

Bang, three quick messages, end of thread.

But instead you draw this out to a couple *dozen* messages by your
insistence that your goal, which makes no sense and renders the entire
thing pointless, is unimportant to the question.

Mike
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Rob Ross
He's also a little hung up on premature optimization. Knuth would not  
be pleased.


Donnie,

What system resources are you trying to free up ?? And why??

Rob

On Jan 12, 2009, at 11:47 AM, I. Savant wrote:


On Mon, Jan 12, 2009 at 2:24 PM, Donnie Lee lpr...@gmail.com wrote:
I am curious to know more about theses system observers. Can you  
explain

us what is it ?


Cocoa observers which sends mouse events, keyboard events etc.


 You should probably read this:

http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/EventOverview/EventArchitecture/chapter_2_section_2.html#

 ... you appear to be misunderstanding how events are handled.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/rob.ross%40gmail.com

This email sent to rob.r...@gmail.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Benjamin Dobson


On 12 Jan 2009, at 19:39:29, Donnie Lee wrote:


I see there is unavoidable problem with my fake button and
Accessibility tools which may happens. I planned to use it to emulate
gradient bottom bar (under Source List control), looks like in
Mail.app. I created three buttons, two gradient action-buttons and one
gradient non-clickable button with image aligned to right. This image
is a three lines which act as
additionalEffectiveRectOfDividerAtIndex: of NSSplitView. It looks
really nice but the fact that is a button...can it hurt people with
Accessibility devices?

Really, I don't like all these additional libraries that try to
emulate gradient bottom bar, because they redraw these controls by
itself, and I would like to use only Apple controls.


Now that explains it. Take a look at NSSegmentedControl.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 I planned to use it to emulate
 gradient bottom bar (under Source List control), looks like in
 Mail.app.

  Is THAT all?!  :-D

  In an attempt to avoid using your own (or third-party) code that
 very specifically and efficiently addresses the problem (because of
 some strange phobia), you're making things so much more difficult than
 is even remotely necessary or sane!

Using gradient buttons is much easier because the controls is already
there, so I don't need to create controls by myself or use 3rd party
code.

  Then create a custom NSView that draws a gradient using the
 *INCREDIBLY EFFICIENT* system calls. Perhaps NSGradient if you're
 requiring 10.5 or above? Maybe CTGradient (the slimmed down version
 someone posted somewhere googlable if you're cruft-phobic)?

Yes, but, as I said before, the controls is already there and I
planned to use them to make the app simpler, but now I see there is
hidden problems.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


RE: Disabled button looks like enabled

2009-01-12 Thread Jon C. Munson II
Yes, it is still an NSButton (or equivalent) after all.  Enabled/Disabled is
simply a state/property of the button.

Peace, Love, and Light,

/s/ Jon C. Munson II

-Original Message-
From: cocoa-dev-bounces+jmunson=his@lists.apple.com
[mailto:cocoa-dev-bounces+jmunson=his@lists.apple.com] On Behalf Of
Donnie Lee
Sent: Monday, January 12, 2009 2:45 PM
To: Jean-Daniel Dupas
Cc: Cocoa Developers
Subject: Re: Disabled button looks like enabled

 Then the window object try to resolve the target responder.

 Each NSView is a responder. I really don't understand how you're trying to
 reduce system resource usage.

Hmm, I don't know internals of Cocoa, I hypothesized that putting a
button in a disabled state can remove focus areas handled by mouse or
something else, which can save a little system resources without big
pain. Are you 100% sure that disabled and enabled buttons takes
identical amount of system resources?

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com

This email sent to jmun...@his.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 He's also a little hung up on premature optimization. Knuth would not be
 pleased.

 Donnie,

 What system resources are you trying to free up ?? And why??

Don't take it to heart. It was just a hypothesis that I can save some
resources by setting the button to disabled state. People here told
that it is wrong and Cocoa handles them equally, and it's great so I
don't need to bother about it.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 3:11 PM, Donnie Lee lpr...@gmail.com wrote:

 Using gradient buttons is much easier because the controls is already
 there, so I don't need to create controls by myself or use 3rd party
 code.
...
 Yes, but, as I said before, the controls is already there and I
 planned to use them to make the app simpler, but now I see there is
 hidden problems.

  Let me be frank: Your apps will always suck if you don't get over
this irrational fear.

  Rarely will you ever create more than the most basic application
that doesn't require some custom UI (be they controls, data views, or
merely decorative elements as you're creating). While your argument
doesn't completely classify as straw man, is absurd. For every
hidden problem you discover when using a UI element for something
completely outside its intended purpose, there are many more you don't
see.

  Again, speaking frankly, it makes your app look and behave like
s**t. It makes any but the most clueless user drag it straight to the
trash and avoid ever using your software again. GUARANTEED.

  Further, purposefully writing code to break a control is infinitely
dirtier than writing a focused, custom control any day. Skanky, even.
Dirty, whore-like skanky. Sores-in-unspeakable-places skanky. It makes
your app a buggy, misbehaving misfit that is highly likely to break in
future versions of the OS ... break in ways you may not even have
imagined.

  For my final point: What do you think you're doing by writing the
event-handling glue code that makes your app to begin with? How is a
purpose-built control any dirtier than your purpose-built glue code?
What about all of Apple's own software that has custom controls and
views specific to the applications and not available as a system-wide
UI element? Are they 'dirty' too?

  My god, has the *whole world* succumbed to the seedy underworld of
dirty, dirty application-specific code?! UNCLEAN
UNCLEAN

  Seriously, get over it.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
It's exactly what I need, Dave. Thank you!
A small question: there is Enable access for assistive devices in
Universal Access, what do you think, can any of these devices treat my
fake button as a real button (even if the button don't accepts first
responder)? Or removing first responder from a button guarantees that
it never be accessible?

On Mon, Jan 12, 2009 at 10:57 PM, Dave DeLong davedel...@me.com wrote:
 I'll also point out that this will work for any NSButton flavor (checkboxes,
 help, recessed, etc).  I just did some further testing to make sure that
 these buttons refuse the focus, and they definitely don't accept being first
 responder.  I created an interface with a bunch of normal buttons, wired up
 the nextKeyView to be sequential, and then wired the last of the normal
 buttons to the first of the FakeButtons.  (I also wired the first normal
 button to be initialFirstResponder).  I turned on full access in SysPrefs,
 then ran the app.

 Hitting the tab button will ONLY tab through the normal buttons.  Even
 though one of the FakeButtons is wired to be the nextKeyView, since it
 refuses first responder, it just jumps to the next thing that does accept
 first responder (this being one of the normal buttons).

 If that doesn't do what he's asking for, then I have no clue what will.

 Dave

 On Jan 12, 2009, at 12:18 PM, Dave DeLong wrote:

 Aha, I see what you're saying.  Well, I just played around with this, and
 subclassing an NSButton as follows will create a button that looks enabled
 but won't respond to mouse clicks and also won't allow users to tab to the
 button (ie, disallows the focus):

 @interface FakeButton : NSButton { }
 @end

 @implementation FakeButton

 - (BOOL) acceptsFirstReponder { return NO; }

 - (BOOL) becomeFirstResponder { return NO; }

 - (void) mouseDown:(NSEvent *)event { return; }

 - (void) mouseUp:(NSEvent *)event { return ; }

 @end

 Just tried it and it works as I've described above.

 Dave

 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:
 http://lists.apple.com/mailman/options/cocoa-dev/lprpro%40gmail.com

 This email sent to lpr...@gmail.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
From what I understand about responders, removing first responder  
guarantees that the control will never be able to accept the focus,  
because accepting the focus would make the control first responder.   
So no; nothing would be able to make this behave as normal button.


Dave

On Jan 12, 2009, at 1:28 PM, Donnie Lee wrote:


It's exactly what I need, Dave. Thank you!
A small question: there is Enable access for assistive devices in
Universal Access, what do you think, can any of these devices treat my
fake button as a real button (even if the button don't accepts first
responder)? Or removing first responder from a button guarantees that
it never be accessible?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Kyle Sluder
On Mon, Jan 12, 2009 at 2:39 PM, Donnie Lee lpr...@gmail.com wrote:
 Really, I don't like all these additional libraries that try to
 emulate gradient bottom bar, because they redraw these controls by
 itself, and I would like to use only Apple controls.

Look at NSSegmentedControl.

--Kyle Sluder
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Now that explains it. Take a look at NSSegmentedControl.

Looks nice, but how to align an image in segment, how to implement
imageDimsWhenDisabled and how to choose button style (I need a pop-up
button there, I found how to add a menu to segment but triangle is not
appears)?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Imagine how the thread might have gone if you had put this information
 in your original e-mail:

No, Michael, that was a simple technical question. Dave's answer was
the best. He even helped me with focus workarounds. Some people told
me something like Don't do it because I don't like that you do it.
Your app will always suck...etc.etc. -- that absolutely don't disturb
me, that are their personal problems.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
Kind regards and gratitude, Dave!

On Mon, Jan 12, 2009 at 11:31 PM, Dave DeLong davedel...@me.com wrote:
 From what I understand about responders, removing first responder guarantees
 that the control will never be able to accept the focus, because accepting
 the focus would make the control first responder.  So no; nothing would be
 able to make this behave as normal button.

 Dave
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
While my answer may be best, now that I know what you're planning to  
do with it, I would still suggest that you use something like  
Brandon's BWToolkit.  Your phobia of third-party controls will just  
make life difficult for you.  For example:  you just spent 10 hours  
trying to replicate a gradient bar, when you could've spent 20 minutes  
downloading Brandon's toolkit, installing it, restarting IB, then  
dragging and dropping in a gradient toolbar yourself, and it would've  
behaved in exactly the same way with no measurable difference in  
performance.


Dave

On Jan 12, 2009, at 2:06 PM, Donnie Lee wrote:


No, Michael, that was a simple technical question. Dave's answer was
the best. He even helped me with focus workarounds. Some people told
me something like Don't do it because I don't like that you do it.
Your app will always suck...etc.etc. -- that absolutely don't disturb
me, that are their personal problems.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Donnie Lee
 Now that explains it. Take a look at NSSegmentedControl.

 Looks nice, but how to align an image in segment, how to implement
 imageDimsWhenDisabled and how to choose button style (I need a pop-up
 button there, I found how to add a menu to segment but triangle is not
 appears)?

 Hmm, you have a point about aligning images. One option would be to simply
 have the image displayed on its own, and the segmented control simply being
 the rightmost segment. It's not pretty, and I actually think Dave's
 suggestion looks nicer in this case.

Yes, Dave's suggestion suits me fine.

Donnie.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread I. Savant
On Mon, Jan 12, 2009 at 4:06 PM, Donnie Lee lpr...@gmail.com wrote:

  Some people told me something like Don't do it because I don't like that 
 you do it.

  Nobody said any such thing.

  Those who told you not to do it gave *valid technical reasons* why
this is a bad idea (one of which you acknowledged) and why it will be
prone to break. That you're being purposefully obtuse in the face of a
helpful and knowledgeable community only reflects poorly on you. What
a shameful display.

--
I.S.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Gregory Weston

Donnie Lee wrote:

Imagine how the thread might have gone if you had put this  
information

in your original e-mail:


No, Michael, that was a simple technical question. ...


The problem is, that when you go to people more experienced than you  
are to ask a simple technical question and people more experienced  
than you are tell you that the very specific thing you're attempting  
is virtually never a sensible tactic and then ask what your goal is so  
they can help you develop a tactic that does make sense, telling those  
people more experienced than you are that they don't know what they're  
talking about is not a particularly constructive course. Don't get  
wedded to tactics. It's the target that's important.


Honest and for true: Sometimes the correct answer to How do I do  
this? is You don't.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Gary L. Wade
Anyone who has been developing Apple/Mac software for more than a few years
can attest that Apple occasionally changes the way that some UI elements
look, in some ways very subtle and in other ways major, and relying upon a
current side-effect of one UI element to look like another element can cause
problems for your users if such a change happens.  If you choose to use a
well-defined option, such as that available in BWToolkit, you and your users
would be far less surprised than if a textured button suddenly showed up
with a radial gradient rather than the linear gradient you are expecting
today.

On 01/12/2009 1:27 PM, Dave DeLong davedel...@me.com wrote:

 While my answer may be best, now that I know what you're planning to
 do with it, I would still suggest that you use something like
 Brandon's BWToolkit.  Your phobia of third-party controls will just
 make life difficult for you.  For example:  you just spent 10 hours
 trying to replicate a gradient bar, when you could've spent 20 minutes
 downloading Brandon's toolkit, installing it, restarting IB, then
 dragging and dropping in a gradient toolbar yourself, and it would've
 behaved in exactly the same way with no measurable difference in
 performance.
 
 Dave
 
 On Jan 12, 2009, at 2:06 PM, Donnie Lee wrote:
 
 No, Michael, that was a simple technical question. Dave's answer was
 the best. He even helped me with focus workarounds. Some people told
 me something like Don't do it because I don't like that you do it.
 Your app will always suck...etc.etc. -- that absolutely don't disturb
 me, that are their personal problems.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee
No offense, Dave -- you've been very generous with your time and  
advice (while also, of course, satisfying your own curiosity :)) --  
but I personally would use I. Savant's original too dirty  
suggestion, which can be implemented in three lines:



@implementation MyButton

- (void)drawRect:(NSRect)rect
{
[[self cell] setEnabled:YES];
[super drawRect:rect];
[[self cell] setEnabled:NO];
}

@end


It would make sense to uncheck the button's Enabled box in IB, but  
with this solution you don't even have to do that.


Granted, I haven't tried all permutations, but this is what I would  
have started with.


--Andy

On Jan 12, 2009, at 4:27 PM, Dave DeLong wrote:

While my answer may be best, now that I know what you're planning  
to do with it, I would still suggest that you use something like  
Brandon's BWToolkit.  Your phobia of third-party controls will just  
make life difficult for you.  For example:  you just spent 10 hours  
trying to replicate a gradient bar, when you could've spent 20  
minutes downloading Brandon's toolkit, installing it, restarting IB,  
then dragging and dropping in a gradient toolbar yourself, and it  
would've behaved in exactly the same way with no measurable  
difference in performance.


Dave

On Jan 12, 2009, at 2:06 PM, Donnie Lee wrote:


No, Michael, that was a simple technical question. Dave's answer was
the best. He even helped me with focus workarounds. Some people told
me something like Don't do it because I don't like that you do it.
Your app will always suck...etc.etc. -- that absolutely don't  
disturb

me, that are their personal problems.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to ag...@mac.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Dave DeLong
None taken.  I really got Cocoa while working on iPhone, so  
understanding what ButtonCells actually do and how they work are still  
things I haven't gotten to yet.  That's why my first idea (after  
understanding the question) was to go look at firstResponder stuff.


Plus, this thread has been more entertaining than paying diligent  
attention in my Principles of Statistics class... ;)


Dave

On Jan 12, 2009, at 3:13 PM, Andy Lee wrote:

No offense, Dave -- you've been very generous with your time and  
advice (while also, of course, satisfying your own curiosity :)) --  
but I personally would use I. Savant's original too dirty  
suggestion, which can be implemented in three lines:


@implementation MyButton

- (void)drawRect:(NSRect)rect
{
[[self cell] setEnabled:YES];
[super drawRect:rect];
[[self cell] setEnabled:NO];
}

@end

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Disabled button looks like enabled

2009-01-12 Thread Andy Lee

On Jan 12, 2009, at 5:59 PM, Dave DeLong wrote:
Plus, this thread has been more entertaining than paying diligent  
attention in my Principles of Statistics class... ;)


What, you're reading cocoa-dev instead of doing what you're SUPPOSED  
to be doing?  I'd tell you how shocked I am, but my boss is coming,  
gotta go...


--Andy

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com