在Dashboard Widget中嵌入Cocoa(图片贴不上去T_T)[28]

[入库:2005年8月19日] [更新:2007年3月24日]

本文简介:选择自 ojv1984 的 blog

有很多人曾经问过关于如何在内部dahsboard调出一个打开面板、保存面板或者打印面板。这是完全有可能的,不过有一些东西需要考虑一下。首先,这三种面板都是低于dashboard的视窗级的,这表示他们默认是不能在dashboard层以上显示的。作为一个例子,我们有这样一个保存面板:

nssavepanel *sp;

int runresult; // holds the returned result button id

 

// pointer to a shared instance of the save panel

sp = [nssavepanel savepanel];

 

// show the window

runresult = [sp runmodalfordirectory:nshomedirectory() file:@""];

 

如果这些代码在dashboard插件内部被调用,它会在dashboard背景层的下面显示。当然,面板的层级也是可以通过下面的代码来改变的:

[sp setlevel:nsscreensaverwindowlevel];

本文关键:在Dashboard Widget中嵌入Cocoa(图片贴不上去T_T)
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top