• 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
finding TableColum during NSTableView selection ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

finding TableColum during NSTableView selection ?


  • Subject: finding TableColum during NSTableView selection ?
  • From: Arnaud Garcia <email@hidden>
  • Date: Wed, 10 May 2006 17:55:13 +0200

Hello,

Many hours but I still not find how to do like in iCal, changing the background color of my cells in my TableView when I Drag the mouse on a selection?


This is how I try to solve the problem:

I use two delegates method of NSTableView, one to find the cells which are selecting and another to change the background color ...

first One:
-----------

- (void)tableViewSelectionIsChanging:(NSNotification *)aNotification
{
int row=[myTableView selectedRow]; //<= good but [myTableView selectedColumn] return -1, since I did not clicked on the TableColumn Header but somewhere in the column !!


...
// update the dataSource to keep this cell status to activated, so I can change its background color later


}

BUT I can't find the associated TableColum ? or may be the selectedCell ?
[myTableView selectedCell] return NULL !

the display part is easy:

second delegate
--------------------

- If I can find the associated TableColumm then I will use:
- (void)tableView: (NSTableView *)aTableView willDisplayCell: (id)aCell
  forTableColumn: (NSTableColumn *)aTableColumn row: (int)aRowIndex
{

this delegate method allows me to change the background of the cells already selected ....
}



Does someone already did something like that ?

thanks

arnaud



_______________________________________________
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


  • Prev by Date: Re: Making an NSTableView accept drag operations
  • Next by Date: Re: Making an NSTableView accept drag operations
  • Previous by thread: Re: NSDocument deprecated routines and compatibility builds
  • Next by thread: C++ gets translated into ObjC? Strange compiler errors...
  • Index(es):
    • Date
    • Thread