Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Has anyone come across the NSToolbar width not being correct in relation to the window width when hiding the title visibility? It seems to be the toolbar isn't preserving the correct size after a quit and restart of the app.
I'm using this in my NSWindow Subclass:
self.window!.titleVisibility = NSWindowTitleVisibility.Hidden
When doing so after the restart of my app the far right hand toolbar items aren't hugging the edge of the window and i can see the toolbar isn't being redrawn to the full extent...
–
I had the same issue. I solved it by removing the toolbar and setting the same toolbar again using GCD (which will actually execute a little later).
Create a subclass of NSWindow and set this class in Interface Builder. Add this to your awakeFromNib:
-(void)awakeFromNib
self.titleVisibility = NSWindowTitleHidden;
NSToolbar* toolbar = self.toolbar;
self.toolbar = nil;
dispatch_async(dispatch_get_main_queue(), ^{
self.toolbar = toolbar;
I found setting the titleVisibility in windowDidLoad() fixed the problem.
override func windowDidLoad() {
super.windowDidLoad()
self.window!.titleVisibility = NSWindowTitleVisibility.Hidden
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.