• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is NSTableView/NSOutlineView the way to go?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is NSTableView/NSOutlineView the way to go?


  • Subject: Re: Is NSTableView/NSOutlineView the way to go?
  • From: Andy Lee <email@hidden>
  • Date: Wed, 15 Jun 2005 21:36:54 -0400

On Jun 15, 2005, at 6:41 PM, Corbin Dunn wrote:
From reading up on NSTableView, I see that it handles the drag moving, editing of text; what I wasn't sure was if I could use a radio group or a custom view (having the radio button, text view, and visibility attributes)…


It sounds perfect for what you want to do. Note that adding NSView's to a TableView has issues (I believe there is source floating around from Chuck on how to do this, if you do need to do it). Ideally, you should just use cell's inside the tableview.

If it helps any, here's the code I use to put checkboxes in the rows of a table. I do this in the -awakeFromNib method:


    NSButtonCell *checkboxCell =
        [[[NSButtonCell alloc] initTextCell:@""] autorelease];

    [checkboxCell setButtonType:NSSwitchButton];
    [[_frameworksTable
        tableColumnWithIdentifier:_AKCheckboxesColumnID]
        setDataCell:checkboxCell];

All you'd have to do is change the checkbox parts to specify radio buttons.

I think you'd also have to manage the "radioness" of the button cells yourself -- i.e., when the user turns one on, turn off the one that was previously turned on. When the cells are in an NSMatrix, you get this for free, but NSTableView uses one cell instance to draw all the cells in a column. So I think you're going to have to implement - tableView:willDisplayCell:forTableColumn:row:.

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Is NSTableView/NSOutlineView the way to go?
      • From: Mark Dawson <email@hidden>
References: 
 >Is NSTableView/NSOutlineView the way to go? (From: Mark Dawson <email@hidden>)
 >Re: Is NSTableView/NSOutlineView the way to go? (From: Corbin Dunn <email@hidden>)

  • Prev by Date: nil after using Interface Builder? (n00b)
  • Next by Date: ODBC/JDBC cocoa framework
  • Previous by thread: Re: Is NSTableView/NSOutlineView the way to go?
  • Next by thread: Re: Is NSTableView/NSOutlineView the way to go?
  • Index(es):
    • Date
    • Thread