When I run the project in the IDE, I get the message that the CocoaLib is missing. This is a Cocoa build. I would have thought that the CocoaLib would be included. What am I not understanding.
P.S. I’m trying to remove masoslib because I was getting errors in my Win build that the CocoaLib could not be loaded.
declare sub setTitleWithRepresentedFilename lib "Cocoa" selector "setTitleWithRepresentedFilename:" (id as Ptr, filePath asCFStringRef)
I get a syntax error. I tried removing the quotes around Cocoa, but that also did not work. Other than that, the line is the same as the previous try.
Paul: When I check masOSLib, I see CocoaLib As String = Cocoa.framework. So I tried
declare sub setTitleWithRepresentedFilename lib "Cocoa.framework" selector "setTitleWithRepresentedFilename:" (id as Ptr, f as CFStringRef) which compiled but did not produce the file icon in the Window Title. Adding the 2nd line
[quote=225625:@Roger Clary]When I use
declare sub setTitleWithRepresentedFilename lib “Cocoa” selector “setTitleWithRepresentedFilename:” (id as Ptr, filePath asCFStringRef)
I get a syntax error.[/quote] asCFStringRef should be as CFStringRef
[code] #if targetCocoa
dim f As FolderItem = gCurQuiz.getCurQuizPath()
if f <> Nil and f.Exists Then
declare sub setTitleWithRepresentedFilename lib "Cocoa.framework" selector "setTitleWithRepresentedFilename:" (id as Ptr, filepath as CFStringRef)
setTitleWithRepresentedFilename Ptr(w.Handle), f.NativePath
end if
#endif[/code]
Worked as desired producing the file icon in front of the Window Title.
Thanks to all who responded.