Re: NSButton/NSBox interaction

2014-04-10 Thread Mailing lists

On 9 Apr 2014, at 22:06, Tom Doan t...@estima.com wrote:

 I have a dialog which has an NSBox. Inside the NSBox are two 
 (separate, but conceptually linked) sets of radio buttons. These are 
 just NSButtons with radio style---I haven't (at least intentionally) 
 embedded them into an NSMatrix. However, when I select one of 
 the buttons from one set, it resets all others in both sets to off so 
 somehow it's automatically interpreting all the buttons inside 
 the box as a single collection even though that's not my intention. 
 However, I can't see anything in the description of either NSButton 
 or NSBox that seems to cover this behavior so I can override it. Can 
 someone explain what's happening, please?
 
I did as you implied and placed two separate matrices inside an NSBox and they 
function independently.

Are you sure that you don’t have all the buttons in a single matrix?

You say that the buttons are linked, are you sure that you are not triggering 
the state of one set from the other?

J

 Thanks,
 
 Tom Doan
 Estima
 
 ___
 
 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:
 https://lists.apple.com/mailman/options/cocoa-dev/lists%40mugginsoft.com
 
 This email sent to li...@mugginsoft.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Keary Suska
On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:

 
 On 10 Apr 2014, at 7:06 am, Tom Doan t...@estima.com wrote:
 
 have a dialog which has an NSBox. Inside the NSBox are two 
 (separate, but conceptually linked) sets of radio buttons. These are 
 just NSButtons with radio style---I haven't (at least intentionally) 
 embedded them into an NSMatrix. However, when I select one of 
 the buttons from one set, it resets all others in both sets to off so 
 somehow it's automatically interpreting all the buttons inside 
 the box as a single collection even though that's not my intention. 
 However, I can't see anything in the description of either NSButton 
 or NSBox that seems to cover this behavior so I can override it. Can 
 someone explain what's happening, please?
 
 
 I'm not exactly certain of the mechanism, but I think radio buttons interact 
 as a set through the agency of their immediate superview, so if several 
 buttons share it, they are assumed to be part of the same set.
 
 So you can embed the separate sets into container views or NSMatrix, and 
 they'll work as you want. You mention NOT putting them into a NSMatrix for 
 some reason - what reason? That's the usual way to set up radios, though it 
 comes with the added restriction that the buttons have to be laid out on a 
 regular grid. But embedding them in a custom view that draws nothing should 
 also work, and that has no such limitation.


That would be great functionality that I have often desired but AFAICT that is 
not the case--at least I am unable to replicate it. Or do you mean multiple 
radio-type NSButtonCells in a single view? That would make sense but only 
NSMatrix has that functionality built-in, AFAIK.

I suspect this is really a code or binding issue.

Keary Suska
Esoteritech, Inc.
Demystifying technology for your home or business


___

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

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Kyle Sluder
 On Apr 10, 2014, at 6:57 AM, Keary Suska cocoa-...@esoteritech.com wrote:
 
 On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:
 
 I'm not exactly certain of the mechanism, but I think radio buttons interact 
 as a set through the agency of their immediate superview, so if several 
 buttons share it, they are assumed to be part of the same set.
 
 So you can embed the separate sets into container views or NSMatrix, and 
 they'll work as you want. You mention NOT putting them into a NSMatrix for 
 some reason - what reason? That's the usual way to set up radios, though it 
 comes with the added restriction that the buttons have to be laid out on a 
 regular grid. But embedding them in a custom view that draws nothing should 
 also work, and that has no such limitation.
 
 
 That would be great functionality that I have often desired but AFAICT that 
 is not the case--at least I am unable to replicate it. Or do you mean 
 multiple radio-type NSButtonCells in a single view? That would make sense but 
 only NSMatrix has that functionality built-in, AFAIK.

I think Graham is referring to this feature, added in 10.8:

 An NSButton configured as a radio button (with the -buttonType set to 
 NSRadioButton), will now operate in a radio button group for applications 
 linked on 10.8 and later. To have the button work in a radio group, use the 
 same -action for each NSButton instance, and have the same superview for each 
 button. When these conditions are met, checking one button (by changing the 
 -state to 1), will uncheck all other buttons (by setting their -state to 0).

https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/

Tom, are you sure that your two sets of radio buttons use different actions?

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

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Tom Doan
This is a Cocoa port of a Carbon app (and I also have Windows and 
GTK versions). My code assumes that I'm controlling the radio 
buttons, which has worked fine until now (apparently the 10.8 SDK). 
What I want is a radio style button which turns on when I want it on 
and turns off when I want it off and doesn't go off and manage itself 
along with the other buttons that the OS thinks (incorrectly in this 
case) are logically linked to it.

Tom Doan
Estima

  On Apr 10, 2014, at 6:57 AM, Keary Suska cocoa-...@esoteritech.com
  wrote:
  
  On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:
  
  I'm not exactly certain of the mechanism, but I think radio buttons
  interact as a set through the agency of their immediate superview,
  so if several buttons share it, they are assumed to be part of the
  same set.
  
  So you can embed the separate sets into container views or
  NSMatrix, and they'll work as you want. You mention NOT putting
  them into a NSMatrix for some reason - what reason? That's the
  usual way to set up radios, though it comes with the added
  restriction that the buttons have to be laid out on a regular grid.
  But embedding them in a custom view that draws nothing should also
  work, and that has no such limitation.
  
  
  That would be great functionality that I have often desired but
  AFAICT that is not the case--at least I am unable to replicate it.
  Or do you mean multiple radio-type NSButtonCells in a single view?
  That would make sense but only NSMatrix has that functionality
  built-in, AFAIK.
 
 I think Graham is referring to this feature, added in 10.8:
 
  An NSButton configured as a radio button (with the -buttonType set
  to NSRadioButton), will now operate in a radio button group for
  applications linked on 10.8 and later. To have the button work in a
  radio group, use the same -action for each NSButton instance, and
  have the same superview for each button. When these conditions are
  met, checking one button (by changing the -state to 1), will uncheck
  all other buttons (by setting their -state to 0).
 
 https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit
 OlderNotes/
 
 Tom, are you sure that your two sets of radio buttons use different
 actions?
 
 --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:
 https://lists.apple.com/mailman/options/cocoa-dev/tomd%40estima.com
 
 This email sent to t...@estima.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Re: NSButton/NSBox interaction

2014-04-10 Thread Tom Doan
Thanks for the help. Embedding each subset inside a custom view 
did fix the problem. It would certainly have been nice to have the 
NSButton class reference say something about the change, since it 
should have been expected to break at least some existing 
software.

 This is a Cocoa port of a Carbon app (and I also have Windows and GTK
 versions). My code assumes that I'm controlling the radio buttons,
 which has worked fine until now (apparently the 10.8 SDK). What I want
 is a radio style button which turns on when I want it on and turns off
 when I want it off and doesn't go off and manage itself along with the
 other buttons that the OS thinks (incorrectly in this case) are
 logically linked to it.
 
 Tom Doan
 Estima
 
   On Apr 10, 2014, at 6:57 AM, Keary Suska
   cocoa-...@esoteritech.com wrote:
   
   On Apr 9, 2014, at 5:30 PM, Graham Cox wrote:
   
   I'm not exactly certain of the mechanism, but I think radio
   buttons interact as a set through the agency of their immediate
   superview, so if several buttons share it, they are assumed to be
   part of the same set.
   
   So you can embed the separate sets into container views or
   NSMatrix, and they'll work as you want. You mention NOT putting
   them into a NSMatrix for some reason - what reason? That's the
   usual way to set up radios, though it comes with the added
   restriction that the buttons have to be laid out on a regular
   grid. But embedding them in a custom view that draws nothing
   should also work, and that has no such limitation.
   
   
   That would be great functionality that I have often desired but
   AFAICT that is not the case--at least I am unable to replicate it.
   Or do you mean multiple radio-type NSButtonCells in a single view?
   That would make sense but only NSMatrix has that functionality
   built-in, AFAIK.
  
  I think Graham is referring to this feature, added in 10.8:
  
   An NSButton configured as a radio button (with the -buttonType set
   to NSRadioButton), will now operate in a radio button group for
   applications linked on 10.8 and later. To have the button work in
   a radio group, use the same -action for each NSButton instance,
   and have the same superview for each button. When these conditions
   are met, checking one button (by changing the -state to 1), will
   uncheck all other buttons (by setting their -state to 0).
  
  https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppK
  it OlderNotes/
  
  Tom, are you sure that your two sets of radio buttons use different
  actions?
  
  --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:
  https://lists.apple.com/mailman/options/cocoa-dev/tomd%40estima.com
  
  This email sent to t...@estima.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:
 https://lists.apple.com/mailman/options/cocoa-dev/tomd%40estima.com
 
 This email sent to t...@estima.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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

NSButton/NSBox interaction

2014-04-09 Thread Tom Doan
I have a dialog which has an NSBox. Inside the NSBox are two 
(separate, but conceptually linked) sets of radio buttons. These are 
just NSButtons with radio style---I haven't (at least intentionally) 
embedded them into an NSMatrix. However, when I select one of 
the buttons from one set, it resets all others in both sets to off so 
somehow it's automatically interpreting all the buttons inside 
the box as a single collection even though that's not my intention. 
However, I can't see anything in the description of either NSButton 
or NSBox that seems to cover this behavior so I can override it. Can 
someone explain what's happening, please?

Thanks,

Tom Doan
Estima

___

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

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

Re: NSButton/NSBox interaction

2014-04-09 Thread Graham Cox

On 10 Apr 2014, at 7:06 am, Tom Doan t...@estima.com wrote:

  have a dialog which has an NSBox. Inside the NSBox are two 
 (separate, but conceptually linked) sets of radio buttons. These are 
 just NSButtons with radio style---I haven't (at least intentionally) 
 embedded them into an NSMatrix. However, when I select one of 
 the buttons from one set, it resets all others in both sets to off so 
 somehow it's automatically interpreting all the buttons inside 
 the box as a single collection even though that's not my intention. 
 However, I can't see anything in the description of either NSButton 
 or NSBox that seems to cover this behavior so I can override it. Can 
 someone explain what's happening, please?


I'm not exactly certain of the mechanism, but I think radio buttons interact as 
a set through the agency of their immediate superview, so if several buttons 
share it, they are assumed to be part of the same set.

So you can embed the separate sets into container views or NSMatrix, and 
they'll work as you want. You mention NOT putting them into a NSMatrix for some 
reason - what reason? That's the usual way to set up radios, though it comes 
with the added restriction that the buttons have to be laid out on a regular 
grid. But embedding them in a custom view that draws nothing should also work, 
and that has no such limitation.

--Graham
___

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

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