• 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: How to deselect a selected row?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to deselect a selected row?


  • Subject: Re: How to deselect a selected row?
  • From: Stéphane Sudre <email@hidden>
  • Date: Wed, 9 Apr 2003 14:06:34 +0200

On mercredi, avr 9, 2003, at 12:57 Europe/Paris, Suman Ganguly wrote:

Hi,

I am very new in Cocoa development area and developed an Cocoa application
using Objective-C. I have a TableView in my application. My requirement is
to deselect a selected row when another mouse-click is done on that row.

Any suggestion or any piece of code will be appreciated.

something like this may work:

create a subclass of NSTableView

write a mouseDown: method that is doing something like this:

- (void) mouseDown:(NSEvent *) aEvent
{
int rowIndex;

// Some code to get the mouseLoc info needs to be added here

rowIndex=[self rowAtPoint:mouseLoc];

if ([self isRowSelected: rowIndex]==YES)
{
[self deselectRow: rowIndex];
}
else
{
[super mouseDown:aEvent];
}
}
_______________________________________________
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.

References: 
 >How to deselect a selected row? (From: Suman Ganguly <email@hidden>)

  • Prev by Date: Newbie: Getting path of file dragged onto NSImageView
  • Next by Date: Re: What to do to deselect a selected row?
  • Previous by thread: How to deselect a selected row?
  • Next by thread: Re: How to deselect a selected row?
  • Index(es):
    • Date
    • Thread