• 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: Using NSCell to bold cells in a tableview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using NSCell to bold cells in a tableview


  • Subject: Re: Using NSCell to bold cells in a tableview
  • From: Jan Van Boghout <email@hidden>
  • Date: Sat, 28 Dec 2002 12:02:15 +0100

It's easier to use the following delegate method:

- (void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell
forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex

Then you can determine which cells to be bold and not bold with
something like this (with cellCanBeBold a boolean that represents
whether your item at row rowIndex and column aTableColumn should be
bold)

if (cellCanBeBold)
[aCell setFont:[NSFont boldSystemFontOfSize:12]];
else
[aCell setFont:[NSFont systemFontOfSize:12]];

Something like this :)


> I am trying to bold just certain rows in my NSTableView. So I have
> done the
> following code (tableDateTime is the NSTableColumn, browserTableView
> is the
> NSTableView):
>
> NSCell *myCell = [tableDateTime dataCellForRow:([browserTableView
> numberOfRows]+1)];
> [myCell setFont:[NSFont boldSystemFontOfSize:12]];
>
> However, it ends up bolding every row in my tableview. If anyone has
> some
> thoughts, please let me know.
>
> Thanks,
> Ben
>
> _______________________________________________
> MacOSX-dev mailing list
> email@hidden
> http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: signal documentation
  • Next by Date: Re: Getting Mouse Moved Events
  • Previous by thread: Re: signal documentation
  • Next by thread: Re: Using NSCell to bold cells in a tableview
  • Index(es):
    • Date
    • Thread