Programmatically change NSMatrix cells' type?

  • I have a NSMatrix with a bunch of NSButton cells in it, in a column.
    What I would like to do is show the list as an alternate list of
    checkboxes and radio buttons.

    [For the curious, this is a sheet that gets shown with a list of
    items to be operated on - in some cases you can select multiple items
    (checkboxes) and at other times just one item (radio button).]

    I tried three approaches:
    - delete all the cells, change the prototype from NSSwitchButton to
    NSRadioButton (or vice versa), then "renew" the cells
    - walk the list of cells and change the type appropriately
    - both together.

    In all cases, I get the style originally defined in IB3:
    switchButton (aka checkbox).

    So, what obvious step did I miss?

    David
  • On Nov 30, 2007, at 7:34 PM, David Hoerl wrote:

    > I have a NSMatrix with a bunch of NSButton cells in it, in a column.
    > What I would like to do is show the list as an alternate list of
    > checkboxes and radio buttons.
    >
    > [For the curious, this is a sheet that gets shown with a list of
    > items to be operated on - in some cases you can select multiple
    > items (checkboxes) and at other times just one item (radio button).]
    >
    > I tried three approaches:
    > - delete all the cells, change the prototype from NSSwitchButton to
    > NSRadioButton (or vice versa), then "renew" the cells
    > - walk the list of cells and change the type appropriately
    > - both together.
    >
    > In all cases, I get the style originally defined in IB3:
    > switchButton (aka checkbox).
    >
    > So, what obvious step did I miss?

    It would be easier just to use a list.  Then, set the list to single
    vs. multiple select as needed.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today