nsopenpanel

NSOpenPanel as sheet

荒凉一梦 提交于 2020-05-11 05:33:53
问题 Ive looked around at other answers, but nothing seems to be helping my case. I have a viewController class which contains an IBAction for a button. This button should open a NSOpenPanel as a sheet from that viewController: class ViewController: NSViewController { @IBAction func folderSelection(sender: AnyObject) { var myFiledialog: NSOpenPanel = NSOpenPanel() myFiledialog.prompt = "Select path" myFiledialog.worksWhenModal = true myFiledialog.allowsMultipleSelection = false myFiledialog

NSOpenPanel as sheet

独自空忆成欢 提交于 2020-05-11 05:33:27
问题 Ive looked around at other answers, but nothing seems to be helping my case. I have a viewController class which contains an IBAction for a button. This button should open a NSOpenPanel as a sheet from that viewController: class ViewController: NSViewController { @IBAction func folderSelection(sender: AnyObject) { var myFiledialog: NSOpenPanel = NSOpenPanel() myFiledialog.prompt = "Select path" myFiledialog.worksWhenModal = true myFiledialog.allowsMultipleSelection = false myFiledialog

NSOpenPanel as sheet

久未见 提交于 2020-05-11 05:33:17
问题 Ive looked around at other answers, but nothing seems to be helping my case. I have a viewController class which contains an IBAction for a button. This button should open a NSOpenPanel as a sheet from that viewController: class ViewController: NSViewController { @IBAction func folderSelection(sender: AnyObject) { var myFiledialog: NSOpenPanel = NSOpenPanel() myFiledialog.prompt = "Select path" myFiledialog.worksWhenModal = true myFiledialog.allowsMultipleSelection = false myFiledialog

Allow all files type except one in NSOpenPanel

我是研究僧i 提交于 2020-01-15 21:00:17
问题 my application create a "new" type (extension) of file, let say its ".newtype", so when i want to browse files with NSOpenPanel to create it, this type of files have to be not selectable. how can i pass ALL files type except ".newtype" to the NSOpenPanel instance ? 回答1: Provide a delegate that handles the NSOpenSavePanelDelegate protocol panel:shouldEnableURL: method. 来源: https://stackoverflow.com/questions/13235130/allow-all-files-type-except-one-in-nsopenpanel

Allow all files type except one in NSOpenPanel

余生长醉 提交于 2020-01-15 20:58:49
问题 my application create a "new" type (extension) of file, let say its ".newtype", so when i want to browse files with NSOpenPanel to create it, this type of files have to be not selectable. how can i pass ALL files type except ".newtype" to the NSOpenPanel instance ? 回答1: Provide a delegate that handles the NSOpenSavePanelDelegate protocol panel:shouldEnableURL: method. 来源: https://stackoverflow.com/questions/13235130/allow-all-files-type-except-one-in-nsopenpanel

can't open image with NSOpenPanel

假如想象 提交于 2020-01-14 06:04:03
问题 I use below code for open image with NSOpenPanel but doesn't work //panel=NSOpenPanel NSString *imgg = [NSString stringWithFormat:@"%@",panel.URL]; self.imgUser.image=[NSImage imageNamed:imgg]; 回答1: The problem is that +[NSImage imageNamed:] doesn't load an image by URL. If you read the documentation, it explains what it actually does: it looks for an image stored in the cache under that name, or stored in the app's bundle or AppKit's framework under that filename. There are a large number of

can't open image with NSOpenPanel

佐手、 提交于 2020-01-14 06:03:42
问题 I use below code for open image with NSOpenPanel but doesn't work //panel=NSOpenPanel NSString *imgg = [NSString stringWithFormat:@"%@",panel.URL]; self.imgUser.image=[NSImage imageNamed:imgg]; 回答1: The problem is that +[NSImage imageNamed:] doesn't load an image by URL. If you read the documentation, it explains what it actually does: it looks for an image stored in the cache under that name, or stored in the app's bundle or AppKit's framework under that filename. There are a large number of

Security-Scoped Bookmarks for a directory

无人久伴 提交于 2020-01-03 15:36:27
问题 I need to give full read/write permission for a directory where the application write some file to this directory. I read that using sandboxed application it required to Enable Security-Scoped Bookmark and URL Access to access a folder after relaunch the app. So I am trying to implement it based on the code here with some minor modification What is the correct way to handle stale NSURL bookmarks? NSOpenPanel* openDlg = [NSOpenPanel openPanel]; [openDlg setCanChooseDirectories:YES]; [openDlg

Presenting NSOpenPanel as sheet synchronously

ε祈祈猫儿з 提交于 2020-01-02 07:54:10
问题 I have a situation where a document file relies on a link to another external media file. When the document is opened, I check to see if the referenced media file is available and if not, then the user is prompted to locate it. Since it makes perfect sense to show an NSOpenPanel as a sheet in a document-based app, I wanted to do that but it is crucial that the current thread is blocked, so no subsequent code can be called until the new media file is chosen. I can't find a way to present this

Title bar missing in NSOpenPanel?

依然范特西╮ 提交于 2019-12-30 09:29:14
问题 Since OS X 10.11 it seems the title bar no longer appears even when using setTitle: does anyone know what happened and how to get the old behavior back? 回答1: From the AppKit Release Notes for OS X v10.11: In 10.11, most NSOpenPanels have adopted a design that was formerly reserved only for applications which adopted iCloud Documents support and this panel design was only used if iCloud Drive was turned on in System Preferences. This note will refer to the design as the “iCloud Open Panel