 |
 |
NSTextView and a little bit of configuring...
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
Hey guys,
This is what I want to achieve, if you open Mail, click Compose and put your cursor in the message NSTextView. You'll notice, that unlike the default NSTextView, the blinking cursor is much more indented.
Curious as I am, I opened up Mail's nib, found the compose window and saw that the text box was a Custom View. I can create custom views for text views, but if I can i'd prefer to use a normal everyday NSTextView, but I need to know how to do the indenting bit, its been driving me mad for ages.
If anyone has an answer/code, please reply!
Thankya
Oliver
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Mar 2000
Location: Ithaca, NY
Status:
Offline
|
|
I believe the method you're looking for is -[NSTextView setTextContainerInset:]. You can use this to specify the padding you want around the text in the text view. There's no UI in Interface Builder for it, but you can just add a line of code to your controller's awakeFromNib method to do it there.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
Hey,
I used that code:
[documentTextView setTextContainerInset: 3];
In awakeFromNib. But when I built I get the error:
error: incompatible type for argument 3 of indirect function call
Any ideas, I've never seen this error before.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Nov 2002
Location: Seattle, WA
Status:
Offline
|
|
that argument would seem to be an NSSize, which is a struct with a float width and a float height
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
Sorry to be a newb, but how do I use floats?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
They're just numbers with a decimal point. 1.1, 5.8703, etc.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2002
Status:
Offline
|
|
Sry to ask, but how would I go about (in my code) setting it up so its 1 from the top and 2 from the sides?
Thanks!
Oliver
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Dec 2001
Location: Wisconsin
Status:
Offline
|
|
[theObject setTextContainerInset:NSMakeSize(desiredWidth, desiredHeight)];
NSMakeSize() is a simple C function that returns a NSSize structure.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|