nstextfieldcell

Is there a "right" way to have NSTextFieldCell draw vertically centered text?

I have an NSTableView with several text columns. By default, the dataCell for these columns is an instance of Apple's NSTextFieldCell class, which does all kinds of wonderful things, but it draws text aligned with the top of the cell, and I want the text to be vertically centered in the cell. There is an internal flag in NSTextFieldCell...

NSTextField on top of custom drawing - black outline and cursor not blinking?

Hey All, I'm completely stumped with this problem. I made a custom search control that uses a few different classes. For some reason, when an NSTextField is anywhere over these different pieces, it displays a solid black border around it, and the cursor doesn't blink. If anyone has a couple minutes - I've put together my code on pasteb...

NSTextFieldCell vertical alignment, solutions seem to squash the horizontal alignment.

I have a NSTextFieldCell that I wish to display with middle vertical alignment. Thanks to an older question here and a blog entry I have two working solutions. However, both solutions seem to squash my ability to set the cell as right aligned. Can anyone help me make either of these solutions support both forms of alignment? Here i...

exfieldCell becomes see through for Borderless Window

Hi, From the example of RoundTransparentWindow, I made my Application window to show only the Parts drawn and the transparent parts are cleared. This works fine. But once I create a custom TableView and click its TextfieldCell to edit, the Cell becomes see through. Can anybody help me what would be my mistake with this CustomWindow and ...

Drawing a rounded cornered NSTextFieldCell

My code for my NSTextFieldCell is: - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { // Drawing code here. NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor lightGrayColor] endingColor:[NSColor grayColor]]; [gradient drawInRect:cellFrame angle:90]; [[self title] drawIn...

Problems faced while customizing NSTextFieldCell

Hi all, I am trying to make cells in an outline view just like we have for users in Skype's message window. For this I created a custom class: IconNameCell.h @interface IconNameCell : NSTextFieldCell { //@private NSImage *userImage; // size (17,17) NSImage *statusIcon; // size (14,14) NSString *...

How do I set the font size in a text cell so that the string fills the cell's rect?

I have a view that contains two NSTextFieldCells. The size at which these cells are drawn is derived from the size of the view, and I want the text in each cell to be the largest that will fit in the derived size of the cell. Here's what I have, which doesn't set the font size: - (void)drawRect:(NSRect)dirtyRect { /* * Observan...

using a custom nstextfieldcell in an nstextfield

I have a custom nstextfieldcell. I thought I could drag a textfield to a xib and click on it's cell, then change the cell's class to my custom class.That doesn't work. Also, I thought I could drag the custom cell from the library (i made a plugin) over the textfield and it would set the new cell like in a table. That doesn't work eithe...

How do I turn off bullets in NSSecureTextField?

I have a password dialog that uses NSSecureTextField and I want to include a "Show password" checkbox so I can show the password being typed in clear text. ...

NSTextFieldCell or just NSCell with vertical text (and colored tinting)

I'm struggling with trying to find an elegant way of displaying the column headers for a table view in a vertical fashion (rotated 90 deg counter clockwise from traditional). I'm not married to doing this as an actual NSTableHeaderCell, I figured it might be easier to do it by overriding NSTextFieldCell or NSCell. The cells only contai...

Binding CoreData Managed Object to NSTextFieldCell subclass

I have an NSTableView which has its first column set to contain a custom NSTextFieldCell. My custom NSTextFieldCell needs to allow the user to edit a "desc" property within my Managed Object but to also display an "info" string that it contains (which is not editable). To achieve this, I followed this tutorial. In a nutshell, the tutoria...

Cocoa: how to implement a custom NSView with an editable text area?

What's the minimum implementation needed to make a custom NSView with an editable text area? I assume NSTextFieldCell can be used for this. I've succeeded in drawing the cell in the view (which is straightforward), but making it editable seems to require a more complicated coordination between the view and the cell. Is there sample code ...

Multiple Lines in NSTextFieldCell

How can I have multiple lines in my NSTextFieldCell in my NSTableView? By this I mean have multiple lines of data: Ex Stack Overflow www.stackoverflow.com turns into this: Stack Overflow www.stackoverflow.com ...

Rounded NSTextFieldCell like iCal

I'm trying to draw an NSTextFieldCell subclass that looks like the rounded event item normal table in iCal. Based on this question, I've got the following code in my subclass: - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:[NSColor lig...

I need to do some advanced text styling of NSTextFieldCell.

First i need some background color on the text only. Like the headers in the F-Script Browser Setting [cell setBackgroundColor: [NSColor blueColor]]; colors the whole cell space not only the text. Also i would need underlined and strikeout text. And to make things readable i would finally like to change the colors (foreground/backgro...

NSOutlineView with badge of unread messages like Mail.app

I'm trying to create a user interface similar to the iTunes source list or the Mail.app mailbox list where a badge with a number (e.g. unread emails, new podcasts) is shown at the right hand side of an element. Based on Apple's SourceList example, I have an NSOutlineView set up to display a couple of groups and a few items in each group...

Text disappears in subclass of NSTextFieldCell

I've spent many hours trying to figure this one out with no luck. Someone had a similar problem on the Apple mailing lists a while ago and no one answered. Basically, it comes down to this: I've subclassed NSTextFieldCell and overridden the drawWithFrame: method to create a custom bezel. Then I call drawInteriorWithFrame: at the end of t...