changing Default paragraphstyle
changing Default paragraphstyle
- Subject: changing Default paragraphstyle
- From: Renaud Boisjoly <email@hidden>
- Date: Mon, 2 Jun 2003 10:47:20 -0400
Hi all
I've searched the list, but I've not found a satisfactory answer to
this. And the documentation did not help either.
What I'm trying to do is change the default paragraph style for a
custom class of NSTextView. When I create a new document in my app,
which contains a subclass of NSTextView, if I set the paragraphstyle to
contain no tabs _and_ set the content of my view to a space, the
paragraph style works and I effectively have a new page with no tab
stops defined.
The problem is that if I set the textview's content to _an empty
string_, then the paragraph style is ignored and I end up with the
default paragraph style for the text which is typed thereafter. I tried
changing the typingattributes for the textview to include a paragraph
style without tab stops, but this does not work.
Why is it so complicated to remove all tab stops in the default
paragraphstyle?
I read about changing this in IB by modifying the Roler in there... but
I cannot do this as I'm using a custom subclass of NSTextView...
I was wondering where a textview was getting the default paragraph
style to use when there is no text in the view... I would have thought
typingAttributes would be the place, but it seems not... unless I did
that wrong.
Can anyone confirm where the default is coming from? Is the textView
calling [NSParagraphView defaultParagraphStyle every time you start
typing in a new view? Is overriding this method the only way to change
the default style? I'm not sure how to override this correctly so as to
not create trouble...
Thanks for any pointer, I'll keep digging...
Renaud
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.