objective c - How to hide file icon in window titlebar of NSDocument -


does know how hide little icon in titlebar of document based app window?

the docs nswindow say:

to customize document icon, can use following code segment:

[[window standardwindowbutton:nswindowdocumenticonbutton] setimage:nil]; 

but doesn't work because window:stardardwindowbutton:nswindowdocumenticonbutton returns nil, which, according docs means button not in window's view hierarchy.

i've looked around nsdocument, doesn't seem refer icon anywhere.

i've tried answers in how show title of document window without icon?, don't work. i'm guessing has changed in mavericks.

another approach override nswindow's standardwindowbutton:forstylemask: class function , return nil buttons wish remove:

class window: nswindow {      class var undesiredbuttons: [nswindowbutton] {          return [.documenticonbutton, .documentversionsbutton]     }      override class func standardwindowbutton(button: nswindowbutton, forstylemask: int) -> nsbutton? {         if contains(undesiredbuttons, button) { return nil }         return super.standardwindowbutton(button, forstylemask: forstylemask)     } } 

Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -