如何显示文档窗口的标题没有图标? [英] How to show a title of document window without icon?
问题描述
现在我将一个文件拖动到坞站中的应用程序图标,这个应用程序是基于文档。我发现在应用程序运行和主窗口打开后,在窗口标题的左侧没有小的图像。但是当我拖动一个文件到应用程序运行之前的停靠图标,并使用此方法运行应用程序,窗口标题左侧的一个小图像显示文件,就像xcode等
现在我想以显示小图像两种方式或不显示小图像两种方式,怎么办?我认为它可能是基于文档的窗口属性,但我不知道如何解决它?谢谢!
Now I drag a file to the app icon in the dock, this app is based on document . I found that no little image on the left of window title after the app is run and the mainwindow is open . but when I drag a file to the dock icon before the app run and use this method to run the app , a little image on the left of window title to show the file ,just like the xcode etc. Now I want to show the little image both way or not to show the little image both way , How to do ? I think that it maybe the window property based on document , but I don't know how to fix it ? Thanks!
我使用 [mainWindow setTitle:tmp];
,但图标仍然出现。当我使用 setTitleWithRepresentedFilename:
我发现图标和窗口标题名都是修改,在文档类中重载 - (void)displayName;
I used the [mainWindow setTitle:tmp];
, but icon still appear. when I used setTitleWithRepresentedFilename:
I found that both icon and window title name both are modify, in the document class I overload the -(void)displayName;
so I want to the window title is fixed anytime.
推荐答案
确定,我发现结果:
1。
[[window standardWindowButton:NSWindowDocumentIconButton] setImage:image]
2。
- (BOOL)window:(NSWindow *)sender shouldPopUpDocumentPathMenu:(NSMenu *)titleMenu
{
return NO;
}
这篇关于如何显示文档窗口的标题没有图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!