Comments on: What a Difference a Cell Makes http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes Mac & Technology Writings by Daniel Jalkut Sun, 16 Mar 2014 19:39:31 +0000 hourly 1 http://wordpress.org/?v=3.8.1 By: Henrik N http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-45510 Thu, 18 Jan 2007 20:46:27 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-45510 Thanks for sharing!

Volker: Thanks for that tip. The triangle didn’t display for me in the last column until I added a temporary column after it.

]]>
By: Volker http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-12329 Sat, 19 Aug 2006 15:24:43 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-12329 Daniel and others,

you can easily use IB only to assign the custom class text cell to any text table column. Just drag the class header to IB from XCode, use the IB Data Panel and drag standard “TextFieldCell” to the according table column. next select the small triangle appearing next to the columns name and choose “Custom Class” from IBs info panel … set RSVertically… as custom calss.

nice work anyhow!

volker

]]>
By: Daniel Jalkut http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-8352 Fri, 30 Jun 2006 14:06:36 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-8352 Gerrit – thanks for sharing this. Unfortunately when I try this technique I still end up with obnoxiously large edit focus frames. I’m sticking with the current, working implementation for now!

]]>
By: Gerrit http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-8201 Wed, 28 Jun 2006 06:45:26 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-8201 If you override drawWithFrame instead of drawingRectForBounds, you don’t have hack around whether you are editing or not. You will still need to override selectWithFrame and editWithFrame, but you can use the adjusted rect, which means the editor will have the proper height for the text as well.

I wasn’t smart enough to figure this out, I just noticed this is how “ImageAndTextCell.m” does it in Apple’s sample code =) So you end up with…

- (void)editWithFrame:(NSRect)frameRect inView:(NSView*)controlView editor:(NSText*)textObject delegate:(id)delegateObject event:(NSEvent*)theEvent
{
[super editWithFrame:[self drawingRectForBounds:frameRect] inView:controlView editor:textObject delegate:delegateObject event:theEvent];
}

- (void)selectWithFrame:(NSRect)frameRect inView:(NSView*)controlView editor:(NSText*)textObject delegate:(id)delegateObject start:(int)selStart length:(int)selLength
{
[super selectWithFrame:[self drawingRectForBounds:frameRect] inView:controlView editor:textObject delegate:delegateObject start:selStart length:selLength];
}

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView
{
[super drawWithFrame:[self drawingRectForBounds:cellFrame] inView:controlView];
}

and can kill ‘mIsEditingOrSelecting’.

]]>
By: Dave Batton http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-8143 Tue, 27 Jun 2006 14:31:51 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-8143 Thank you! This is just what I needed for my current project. :-)

]]>
By: moore http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-7950 Fri, 23 Jun 2006 20:15:13 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-7950 Yes …
good work
is beautiful

thanks !

]]>
By: Rikki http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-7862 Thu, 22 Jun 2006 14:52:55 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-7862 I just found your blog and I’ve really enjoyed reading it. I’m a freelance writer working on a book about computer/tech advice and I could really use some help with some tips on Macs and other apple software. Let me know if you’re interested in helping (it wouldn’t take much time.)
Rikki

]]>
By: Damien http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-7703 Tue, 20 Jun 2006 12:56:31 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-7703 Great, I’ve used it succesfully in my own project. No bugs so far :)
Thanks for sharing!

]]>
By: alexr http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes/comment-page-1#comment-7666 Mon, 19 Jun 2006 22:55:31 +0000 http://www.red-sweater.com/blog/148/what-a-difference-a-cell-makes#comment-7666 I’ve been using a ValueTransfomer to present bound cell contents as NSAttributedString and applying an attribute of NSBaselineOffsetAttributeName with a new baseline. I haven’t tried it with editable cells yet but I suspect they won’t work as well as your solution.

]]>