Skip navigation.
 
mlRe: north - east - south - west selector using NSMatrix?
FROM : Ricky Sharp
DATE : Tue Aug 29 23:54:50 2006

On Aug 29, 2006, at 4:19 PM, patrick machielse wrote:

> I'm trying to implement a control area for selecting a direction 
> (north - east - south - west, or top - right - bottom - left). Only 
> one of these choices can be selected at one time.
>
> My first try was to use an NSMatrix with radio buttons. In IB I 
> created a 3x3 matrix of radio buttons and I disabled and made 
> transparent the buttons at indeces 0, 2, 4, 6, and 8. The problem 
> is that I can still 'select' the buttons at these indexes by 
> clicking on their locations, in which case none of the enabled and 
> visible radio buttons is selected.
>
> Since this type of control seems fairly common, I was wondering 
> what solutions other people are using, and if there is a better way 
> to do it than I'm using now (I suppose so!).


I was able to do what you want, without the side-effects you report 
above.

I did this on 10.4.7 (not sure what things will do on 10.3 and earlier)

Started with a square push button and set it to have an "On/Off" 
behavior.  Dragged out a 3 x 3 matrix.  Center and four corner cells 
were set to be disabled and to not have a border.  "North" cell set 
to be selected.  Matrix mode set to Radio.

Clicking in any of the "dead" cells does nothing.  Clicking on the 
others lets you select them and you can even drag-select amongst the 
four choices.

I'll e-mail you my test nib privately.

___________________________________________________________
Ricky A. Sharp        mailto:<email_removed>
Instant Interactive(tm)  http://www.instantinteractive.com

Related mailsAuthorDate
mlnorth - east - south - west selector using NSMatrix? patrick machielse Aug 29, 23:19
mlRe: north - east - south - west selector using NSMatrix? Ricky Sharp Aug 29, 23:54
mlRe: north - east - south - west selector using NSMatrix? patrick machielse Aug 30, 00:30