Re: NSButton and NSEvent

2010-02-27 Thread Jeremy Matthews
Steven,

Thanks - the project needed a revisit...it grew from 2 checkboxes to nearly 
40...time to re-examine a few things!

Thanks again for the tipso deep into the forest I could not see the trees...

-j

On Feb 27, 2010, at 1:23 PM, Steven Degutis wrote:

> First of all, you may want to look into NSMatrix to accomplish this task 
> instead of using individual NSButtons, both for performance reasons and (more 
> importantly) to use the Cocoa API as it is intended (this is why NSMatrix was 
> created, so it handles this relatively well).
> 
> Secondly, if you use NSMatrix, or even NSTableView (which may be a better 
> layout in this case), you can populate the items programmatically. Thus, you 
> can have an array of model objects representing the data, with properties 
> such as "userVisibleTitle" and "representedCommandLineOptionString" or 
> something to that effect (and possibly an ID property too if need be, but 
> probably not). Then you could supply these to the views rather easily, and 
> readily fetch and display any property for a given object. Read more about 
> this in the MVC section of Apple's docs.
> 
> Also, regarding your feature to toggle the display between power users and 
> "normal users", there's a few options. You could do this via tooltips, or you 
> could have an option to choose to display the "normal" titles versus the 
> command line options. But keep in mind, power users will probably prefer the 
> command line anyway, usually. So I wouldn't put too much thought into this.
> 
> -Steven
> 
> On Sat, Feb 27, 2010 at 8:46 AM, Jeremy Matthews  
> wrote:
> So I have a application that I am getting ready to put some finishing touches 
> on, but there are one or two things I'd like to do differently...er, better.
> 
> It is a simple tool (Cocoa Desktop app) with a slew of checkboxes (around 40 
> in a separate window) that act as parameters on a command. While I show the 
> user-friendly wording "yard work", behind the scenes I actually use 
> parameters like "-lawngeneral" (if that checkbox is selected it does a check 
> and provides the internal naming scheme when it builds the full command). 
> Since the latter are part of the internal logic (and affect other systems), 
> they cannot be changed at this time. But, I would like to be able to give 
> those nsbuttons a second property that does not change depending on selection 
> (so, alternateTitle would not work), just to make life easier when 
> referencing said items. In NSMenu land, someone mentioned using 
> setRepresentedItems, which worked great in my needs there...is there a 
> similar feature for NSButton (specifically checkboxes)?
> 
> Also, it would be nice if I could intercept an nsevent that changed their 
> text from the user-friendly version to the internal logic titles - if only 
> for some better understanding by power users (like, holding down the option 
> key at any point in time). I've mucked around with some examples, but it 
> seems like most depend on a a specific method and not silently observing in 
> the background, like clicking on a button.
> 
> How would you handle the first request, create a dictionary, or is there 
> another method I missed?
> And the second, I'm not even sure..
> 
> Any ideas?
> 
> ___
> 
> 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/steven.degutis%40gmail.com
> 
> This email sent to steven.degu...@gmail.com
> 
> 
> 
> -- 
> Steven Degutis
> http://www.thoughtfultree.com/
> http://www.degutis.org/

___

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: NSButton and NSEvent

2010-02-27 Thread Steven Degutis
First of all, you may want to look into NSMatrix to accomplish this task
instead of using individual NSButtons, both for performance reasons and
(more importantly) to use the Cocoa API as it is intended (this is why
NSMatrix was created, so it handles this relatively well).

Secondly, if you use NSMatrix, or even NSTableView (which may be a better
layout in this case), you can populate the items programmatically. Thus, you
can have an array of model objects representing the data, with properties
such as "userVisibleTitle" and "representedCommandLineOptionString" or
something to that effect (and possibly an ID property too if need be, but
probably not). Then you could supply these to the views rather easily, and
readily fetch and display any property for a given object. Read more about
this in the MVC section of Apple's docs.

Also, regarding your feature to toggle the display between power users and
"normal users", there's a few options. You could do this via tooltips, or
you could have an option to choose to display the "normal" titles versus the
command line options. But keep in mind, power users will probably prefer the
command line anyway, usually. So I wouldn't put too much thought into this.

-Steven

On Sat, Feb 27, 2010 at 8:46 AM, Jeremy Matthews wrote:

> So I have a application that I am getting ready to put some finishing
> touches on, but there are one or two things I'd like to do differently...er,
> better.
>
> It is a simple tool (Cocoa Desktop app) with a slew of checkboxes (around
> 40 in a separate window) that act as parameters on a command. While I show
> the user-friendly wording "yard work", behind the scenes I actually use
> parameters like "-lawngeneral" (if that checkbox is selected it does a check
> and provides the internal naming scheme when it builds the full command).
> Since the latter are part of the internal logic (and affect other systems),
> they cannot be changed at this time. But, I would like to be able to give
> those nsbuttons a second property that does not change depending on
> selection (so, alternateTitle would not work), just to make life easier when
> referencing said items. In NSMenu land, someone mentioned using
> setRepresentedItems, which worked great in my needs there...is there a
> similar feature for NSButton (specifically checkboxes)?
>
> Also, it would be nice if I could intercept an nsevent that changed their
> text from the user-friendly version to the internal logic titles - if only
> for some better understanding by power users (like, holding down the option
> key at any point in time). I've mucked around with some examples, but it
> seems like most depend on a a specific method and not silently observing in
> the background, like clicking on a button.
>
> How would you handle the first request, create a dictionary, or is there
> another method I missed?
> And the second, I'm not even sure..
>
> Any ideas?
>
> ___
>
> 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/steven.degutis%40gmail.com
>
> This email sent to steven.degu...@gmail.com
>



-- 
Steven Degutis
http://www.thoughtfultree.com/
http://www.degutis.org/
___

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


NSButton and NSEvent

2010-02-27 Thread Jeremy Matthews
So I have a application that I am getting ready to put some finishing touches 
on, but there are one or two things I'd like to do differently...er, better.

It is a simple tool (Cocoa Desktop app) with a slew of checkboxes (around 40 in 
a separate window) that act as parameters on a command. While I show the 
user-friendly wording "yard work", behind the scenes I actually use parameters 
like "-lawngeneral" (if that checkbox is selected it does a check and provides 
the internal naming scheme when it builds the full command). Since the latter 
are part of the internal logic (and affect other systems), they cannot be 
changed at this time. But, I would like to be able to give those nsbuttons a 
second property that does not change depending on selection (so, alternateTitle 
would not work), just to make life easier when referencing said items. In 
NSMenu land, someone mentioned using setRepresentedItems, which worked great in 
my needs there...is there a similar feature for NSButton (specifically 
checkboxes)?

Also, it would be nice if I could intercept an nsevent that changed their text 
from the user-friendly version to the internal logic titles - if only for some 
better understanding by power users (like, holding down the option key at any 
point in time). I've mucked around with some examples, but it seems like most 
depend on a a specific method and not silently observing in the background, 
like clicking on a button.

How would you handle the first request, create a dictionary, or is there 
another method I missed?
And the second, I'm not even sure..

Any ideas?

___

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