right clic on window title ?

Hi all,

I assume it’s a mac only feature ( but correct me if I’m wrong)
how can you have the path of a document when you right clic on the window title ?
does it need declares ?
can you emulate it with a menuitem at the right place ?

thanks.

You have to use declare.

Axel shared a way to do that some times ago. A quest have to be done.

Emile, you mean this? https://forum.xojo.com/conversation/post/221462

(Sam did most of the work)

thanks Axel, as always !
do you have a link to “fakepopwin.zip” two posts before, that leads to your old spammed web site …

https://www.dropbox.com/s/3rdrj7rrcdra43f/fakepopwin.zip?dl=1

strange - your “titlemenu” program stops with an error in the main.event.open method

-[XOJWindow setTitlebarAppearsTransparent:]: unrecognized selector sent to instance 0x6e6a70

it stops at the line setTitlebarAppearsTransparent(self.Handle, true)

what can it be ?

I still use OS X 10.10.5, there it works. (2015r1 & 2016.r21)

I have 10.9.5 and 2016r21

In 10.9, it does not work.

Available in OS X v10.10 and later.

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/#//apple_ref/occ/instp/NSWindow/titlebarAppearsTransparent

I commented the line and it worked straight …

in fact I only need the declare :

soft declare sub setRepresentedFilename lib "Cocoa" selector "setRepresentedFilename:" _ (WindowRef As Integer, inPath As CFStringRef)

and you simply call it when you have a folderitem f associated to your window with :

if f<>nil then setRepresentedFilename TrueWindow.Handle, f.nativepath TrueWindow.Title=f.Name.Replace("." + NthField(f.Name, ".", CountFields(f.Name, ".")),"") else setRepresentedFilename TrueWindow.Handle, "" end if

and this works from “os x 10.0 and later” …

thanks for your help.
nobody answered for that but it’s really not available for windows ?

wrote a simple method to insert in your mac project to do it easy.

[code]Sub setRepresentedFilename(extends w as Window, f as FolderItem, setWindowTitlewithFileName as Boolean=False)
#if TargetCocoa then

soft declare sub setRepresentedFilename lib "Cocoa" selector "setRepresentedFilename:" (WindowRef As Integer, inPath As CFStringRef)

if f<>nil and w<>nil then
  setRepresentedFilename w.TrueWindow.Handle, f.nativepath
  if setWindowTitlewithFileName then
    w.TrueWindow.Title=f.Name.Replace("." + NthField(f.Name, ".", CountFields(f.Name, ".")),"")
  end if
else
  setRepresentedFilename w.TrueWindow.Handle, ""
end if

#endif

End Sub
[/code]

It is not standard, but I believe it should be pretty easy to do with a contextual menu popup.