NStoolbar in NSWindow position is change - objective-c

I am adding toolbar in NSwindow. When the window is opened and close the window again when I open the window, the window position is changed.
Any Ideas?

Related

How to hide title bar of NSWindow but close and minimize button should be visible?

I want to hide the title bar of NSWindow. But the close button and minimize button of NSWindow should be visible. Also, the window should be drag anywhere on the screen after hiding the title bar.
I have referred to the below link.
Xcode & Swift - Window without title bar but with close, minimize and resize buttons
But this is not working for me.
I want to make exactly the same window as shown in below image.

How to customize the segue animation to show an NSWindowController?

I am attempting to create a preferences window using a storyboard, as was briefly demonstrated in WWDC 2014 Session 212 - Storyboards and Controllers on OS X. I have a "Preferences…" menu item that should show the preferences window when clicked. In Interface Builder, I connected the action segue for the preferences menu item to the preferences window controller. When I select the "Modal" style for the storyboard segue, then the preferences window is shown when the preferences menu item is clicked, but it is animated into view.
I would like the preferences window to be shown without any animation, like what happens when you open Xcode > Preferences or Safari > Preferences.
I have tried creating a custom NSStoryboardSegue and overriding the perform method in two different ways:
Call the showWindow: method of the destinationController (the NSWindowController).
This does not show the preferences window.
Actually, the window briefly flashes on screen behind all of the other windows, and then disappears.
Call the makeKeyAndOrderFront: method on the storyboard segue's window.
The window starts to appear, but disappears soon after. It seems that the window is being animated into view, but the window is abruptly hidden at the end of the animation.
How do I customize the segue to show the window without animating?

Resize NSWindow from bottom left corner only?

I am writing an application that sits in the OS X menu bar and when you press its icon a little NSPanel opens up. I would like the user to be able to resize it, but only by dragging the bottom left corner. I want to prevent them from being able to drag the top edge down and "unstick" the window from the menu bar.
Just override touchesBegan mouseDown: and pass on the drag only if it is in the designated corner, discarding other touches.
See Cocoa Event Handling Guide

NSTableView in NSDrawer issue

Currently i am developing a app with a borderless window and a NSDrawer within the borderless window,and there is a NSTableView in the drawer.
Problem is when i select a row in the table,and then click the miniaturize button i create manually in the borderless window,it's useless,nothing happens.but when i close the drawer,the miniaturize button works fine.
Try sending -close: to the drawer before miniaturizing the window.

Custom tooltip that can overhang NSWindow?

I need to create a custom tooltip for my app yet I want it to act like a normal tooltip and overhang the top level window if the cursor is near the bottom or right edges. Do I need to make the tooltip control an NSWindow itself or is there a way to get an nsview to pop outside the window bounds.
So the solution for this was to create an NSPanel that is setFloatingPanel:YES. On mouse enter of the view I call orderToFront on the panel, on mouse move I setFrameOrigin and on mouse exit I orderOut.