• 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
Hightlight on mouseover a NSTextFieldCell inside a TableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Hightlight on mouseover a NSTextFieldCell inside a TableView


  • Subject: Hightlight on mouseover a NSTextFieldCell inside a TableView
  • From: Gustavo Pizano <email@hidden>
  • Date: Tue, 1 Dec 2009 11:06:53 +0100

Hello, I have been searching how to achieve this.
I have a NSTableView and the NSTableCells are a subclass I made.
Now I want to change the backgorund color of the table row when mouse over.  In my SubClass of NSTextFieldCell I tried overriding these methods
- (BOOL)startTrackingAt:(NSPoint)startPoint inView:(NSView *)controlView{
	NSLog(@"tracking.. %@",[self stringValue]);
	return YES;
}


- (BOOL)trackMouse:(NSEvent *)theEvent inRect:(NSRect)cellFrame ofView:(NSView *)controlView untilMouseUp:(BOOL)untilMouseUp{
	NSLog(@"here");
	return YES;
}


off course I see nothing of the logs.. it was just a tryout. .. now i dunno how to make NSTextFieldCell respond to mouse events, i.e a mouse entered, this for NSResponder class and subclasses, so  I was thinking in defining a NSTrackingArea, but because of NSTextField don't accept mouseEntered method then  I dunno.

I thought then maybe to subclass NSTableView, and do something with the point f the mouse, and then get the row at point, form the NSTableView, but this method returns me a integer,  so then I will multiply by the row height and create a NSREct and draw a background in that rect, but I dunno if this is a good approach.

Any ideas?


Thanks


Gustavo

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Hightlight on mouseover a NSTextFieldCell inside a TableView
      • From: Corbin Dunn <email@hidden>
    • Re: Hightlight on mouseover a NSTextFieldCell inside a TableView
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: What to subclass in NSArrayController to enable immediate editing of added rows?
  • Next by Date: Re: copyWithZone - if anyone could explain this to me ?
  • Previous by thread: Re: What to subclass in NSArrayController to enable immediate editing of added rows?
  • Next by thread: Re: Hightlight on mouseover a NSTextFieldCell inside a TableView
  • Index(es):
    • Date
    • Thread