Re: Modifying TextEdit.app
Re: Modifying TextEdit.app
- Subject: Re: Modifying TextEdit.app
- From: Andy Lee <email@hidden>
- Date: Wed, 20 Aug 2008 12:26:28 -0400
Sounds like TextEdit is an NSDocument-based app. I'm not familiar
with those, but I see NSDocument has a -displayName method whose
documentation says:
"If the document has been saved, the display name is the last
component of the directory location of the saved file (for example,
“MyDocument” if the path is “/tmp/MyDocument.rtf”). If the document is
new, NSDocument makes the display name “Untitled n,” where n is a
number in a sequence of new and unsaved documents. The displayable
name also takes into account whether the document’s filename extension
should be hidden. Subclasses ofNSWindowController can override
windowTitleForDocumentDisplayName:to modify the display name as it
appears in window titles."
This would explain why you didn't see an explicit call to -setTitle:
in the code -- that's taken care of by the framework. You can
override to customize the framework's default behavior.
--Andy
On Aug 20, 2008, at 12:13 PM, R.L. Grigg wrote:
Im more or less a Cocoa newb and building and modifying the TextEdit
example has been very helpful. I ve modified it so it can do some
simple things like having adjustable margins instead of the fixed 1"
margins, etc. So far so good.
Now I want to modify TextEdit so I can display the filenames full
path in the title bar of the document window instead of just the
filename.ext (because sometimes I have more than 1 version of a file
up and its easy to forget which one is which). Ive gone over the
code but I simply cannot figure out how TextEdit sets the window
title! Theres nothing obvious like -setTitle: etc. Is this something
thats done behind the scenes by Cocoa when a file gets loaded? Im
stumped...
Thx,
Russ
OSX 10.5.4 Xcode 3.1
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden