Community
Participate
Working Groups
I'm trying to make use of NSApplication.arrangeInFront & NSWindow.setRepresentedFilename for few mac tweaks. It would be great to have those methods in the SWT Cocoa internal classes (without them I'm unable to proceed). These methods are not directly used in SWT, so there is no reason for SWT to add them. Thats why I decided to bribe with a beer for the person who adds these :-)
Can't you just use OS.sel_registerName() to define them for yourself? They're just selectors. I guess they would be more convenient if they were callable from Java. setRepresentedFileName is a feature I know folks have been looking for, so that's no problem at all. arrangeInFront implies you're adding a Window menu, or going to make one available. What are you adding there?
(In reply to comment #1) > Can't you just use OS.sel_registerName() to define them for yourself? They're > just selectors. I guess they would be more convenient if they were callable > from Java. For both the methods, I'm currently doing that. // on the class level private static final long sel_setRepresentedFilename = OS .sel_registerName("setRepresentedFilename:"); //elsewhere in a method NSWindow nsWindow = window.getShell().view.window(); NSString filePathString = NSString.stringWith(path); OS.objc_msgSend(nsWindow.id, sel_setRepresentedFilename, filePathString.id); This is currently working fine for me. I'm on Cocoa 64 bit and not sure whether this will work fine in 32 bit, (where its int all over the methods instead of long). > setRepresentedFileName is a feature I know folks have been looking for, so > that's no problem at all. arrangeInFront implies you're adding a Window menu, > or going to make one available. What are you adding there? If you haven't noticed, Minimize & Zoom added to the Window menu in the recent Cocoa nightly builds. The last missing standard mac menu item in the Windows menu is 'Bring All to Front' one. (and a fix for Bug# 187052)
Added arrangeInFront:, setRepresentedFilename: and setRepresentedURL:. One might be easier to use than the other.
I forgot about 32 vs 64 bit. It will be easier to call these from Java, since the SWT hides that from you. Fixed > 20101012.
Thanks Scott! Remind me of the beer when we meet :-)