Hello,
At the end of the name of an Apple’s TexEdit Document there is a “V-like” character.
When clicked a window opens wit
Name: the name of the document
Tags: a box for tags, and
Where: a Bevelbutton to navigate a location
I think that is a nice feature…
How can I implement that?
Thanks.
Lennox
Not easily. Supposedly you need to create a NSDocument subclass, handle the correct events and then attach it to the Window. I’ve done that, but still don’t get the option (and that was quite a bit of code).
It’s one of those ‘magical’ features that comes automatically with a NSDocument based Objective-C/Swift application, which I’ve never been able to fully crack with Xojo.
It’s been on my list of things to do for years.
OK Sam, thanks,
I would not try to venture there.
Thanks again.
Lennox
[quote=355413:@Lennox Jacob]OK Sam, thanks,
I would not try to venture there.
Thanks again.
Lennox[/quote]
I wouldn’t say don’t go there at all. If anything I’ve given you the general idea of how I think it’s supposed to work, who knows you may be able to go further than I did.
#if TargetMacOS
Declare Sub setTitleWithRepresentedFilename Lib "Cocoa" Selector "setTitleWithRepresentedFilename:" _
(NSWindow As Ptr, filePath As CFStringRef)
//setTitleWithRepresentedFilename(Ptr(Handle), "abc.txt")
#endif
in the file/save code:
[code] #if TargetMacOS
dim f as folderitem
f = GetFolderItem( ??? ) // the file that represents the document this window is dsiplaying
self.title = f.displayname
setTitleWithRepresentedFilename(Ptr(self.handle), f.nativepath)
#endif
[/code]
[quote=355418:@Jeff Tullin] #if TargetMacOS
Declare Sub setTitleWithRepresentedFilename Lib "Cocoa" Selector "setTitleWithRepresentedFilename:" _
(NSWindow As Ptr, filePath As CFStringRef)
//setTitleWithRepresentedFilename(Ptr(Handle), "abc.txt")
#endif
in the file/save code:
[code] #if TargetMacOS
dim f as folderitem
f = GetFolderItem( ??? ) // the file that represents the document this window is dsiplaying
self.title = f.displayname
setTitleWithRepresentedFilename(Ptr(self.handle), f.nativepath)
#endif
[/code][/quote]
Definitely not the same thing.
shao_sean
(shao sean)
October 21, 2017, 6:44am
7
Which requires subclassing the NSDocument object, capturing the correct events and attaching the NSDocument to the Window.
shao_sean
(shao sean)
October 21, 2017, 8:03am
9
Just wanted to point out the exact feature that provides the functionality, incase someone was bored and decided to try to implement it…