gpt4 book ai didi

objective-c - 如何在 cocoa 中创建 "Choose Dialog"?

转载 作者:行者123 更新时间:2023-12-03 17:09:47 27 4
gpt4 key购买 nike

在 Apple 人机界面指南中,有一个关于 Choose Dialogs 的部分,与打开对话框不同:

By default, the dialog’s title is “Choose.” If, for example, the command that displays the dialog is Choose Picture, title the dialog “Choose Picture.” If it’s helpful, also change the Choose button to something more specific.

但是,我无法找到任何有关如何创建一个文档,而不是常规的 NSOpenPanel

最佳答案

尝试以下操作:

NSOpenPanel *openPanel=[NSOpenPanel openPanel];
[openPanel setTitle: @"Choose File"];
[openPanel setPrompt: @"Choose"];
[openPanel setCanChooseDirectories: YES];
[openPanel setCanChooseFiles: NO];
if ([openPanel runModal] != NSCancelButton)
{
// Use -[openPanel URL]...
}

关于objective-c - 如何在 cocoa 中创建 "Choose Dialog"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41601373/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com