如何在Cocoa中创建和显示自定义工作表? [英] How to Create And Display a Custom Sheet in Cocoa?

查看:135
本文介绍了如何在Cocoa中创建和显示自定义工作表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个新手问题!

如何在Cocoa中创建并显示自定义工作表 Safari - 见下文)

How to Create And Display a Custom Sheet in Cocoa? (like "Add Bookmark" sheet in Safari - see below)


  • 任务涉及的步骤是什么?

  • 如何完成

推荐答案

要做一个包含您要用作工作表的NSWindow的nib文件,并加载它。请查看使用自定义表格

All you need to do is make a nib file containing an NSWindow that you want to use as the sheet, and load it up. Check out Using Custom Sheets in the docs.

NSApplication 有一种方法可让您加载工作表:

NSApplication has a method to let you load the sheet up:

beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:


b $ b

此网页有一些更多信息和我会考虑一个更简单的方法来设置工作表 - 将其作为与文档窗口相同的nib文件中的面板或窗口。

This page has some more information and what I'd consider an easier way to set up the sheet - making it a panel or window inside the same nib file as your document window.

这篇关于如何在Cocoa中创建和显示自定义工作表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆