Questions tagged [nstextfieldcell]

94 questions
1
vote
1 answer

Cocoa : Multiline NSTextFieldCell in a NSOutlineView

I am developing a Cocoa application. I have a NSOutlineView displaying custom cells ( cells inherits from NSTextFieldCell). The problem I am facing to is that the cell text is only displayed on one line... how can I have a multiline textField…
ayorosmage
  • 1,607
  • 1
  • 15
  • 21
1
vote
1 answer

Autosizing text in NSTextFieldCell (Swift 3) for MacOS App

My problem: I am building a MacOS app in Swift 3 and am looking to auto-resize (change font-size) text in a NSTextFieldCell, such that the text is always visible in its container. I have come across Get NSTextField contents to scale but am not sure…
Kirill Miniaev
  • 151
  • 2
  • 6
1
vote
0 answers

Correct way to redraw NSTextView

Trying to make URL validation NSTextField where I draw caution image in case of wrong URL. Everything works but I am not sure if I am fighting the API and there is other way. I am calling noteFocusRingMaskChanged to redraw keyboard focus ring,…
Marek H
  • 5,173
  • 3
  • 31
  • 42
1
vote
1 answer

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.…
Lothar
  • 12,537
  • 6
  • 72
  • 121
1
vote
2 answers

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…
Stuart Tevendale
  • 614
  • 6
  • 19
1
vote
2 answers

Swift/OSX - Disabling Focus Ring on customized NSSecureTextField

I'm trying out some styling of NSTextFields to get Single Line Text Fields like the Material Design ones. With normal NSTextFields I have no problems, it works out pretty well. I'm subclassing the NSTextFieldCell and draw my custom cell (simply with…
1
vote
1 answer

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
Matt S.
  • 13,305
  • 15
  • 73
  • 129
1
vote
1 answer

Resize NSImage in custom NSTextFieldCell

I created drag and drop app using Apple's example: https://developer.apple.com/library/mac/samplecode/SourceView/Introduction/Intro.html I load actual image of dragged file. When I drag for example this image file into my NSOutlineView, I see that…
KAMIKAZE
  • 420
  • 6
  • 27
1
vote
1 answer

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]…
nanochrome
  • 707
  • 2
  • 12
  • 26
1
vote
0 answers

Several Hyperlinks in NSTableView Cell

At the moment I have an NSTableView with a custom NSTextFieldCell that holds an NSAttributedString with some ranges with the NSLinkAttribute. I tried to integrate code from Apple's TableViewLinks example and Toomas Vather's HyperlinkTextField. I…
david.has
  • 11
  • 1
1
vote
1 answer

NSTextFieldCell standard text drawing position

Is there a way to get the position where the text in an NSTextFieldCell will be drawn when you call [super drawInteriorWithFrame:cellFrame inView:controlView] in drawInteriorWithFrame:inView: ?
user1360618
1
vote
1 answer

NSTextField: how do I add a search icon as in other apps?

How can I add a search icon on the left in a NSTextField? You can see the same in many other applications.
Albert
  • 65,406
  • 61
  • 242
  • 386
1
vote
1 answer

Create a complex custom nstextfieldcell

I'm trying to create a custom NSTextFieldCell for a NSTableView. I want to do something like the email listing provided by Mail (example below). I found some references here and here, but I'm not able to evolve. I think that it's not as simple as a…
Bob Rivers
  • 5,261
  • 6
  • 47
  • 59
1
vote
1 answer

Text attribute changed for NSTextFieldCell on selection

I have a tableview on which selecting a column of a row will call overridden method - (void)selectWithFrame:(NSRect)inCellFrame inView:(NSView *)inControlView editor:(NSText *)textObj delegate:(id)anObject start:(NSInteger)selStart…
boom
  • 5,856
  • 24
  • 61
  • 96
0
votes
1 answer

Why doesn't an editable Cocoa text field cell draw a shadow?

So, it works fine if I disable editing for the textfield/textfieldcell... through code or interface builder. (notice the slight shadow) But once I make it editable ([cell setEditable:YES]) the shadow completely disappears: I've tried drawing a…
Vervious
  • 5,559
  • 3
  • 38
  • 57