I show the circular progressbar in NSPanel, when the panel first time opened, it works fine. When it is hidden, and opened again, the circular progressbar only animates when key pressed or mouse moved.
Related
Click the minimized window on the taskbar to restore it.
At this time, the slide animation is played and restored.
Can i detect when the animation ends?
This message is generated the moment it is clicked.
(WM_ACTIVATE, SC_RESTORE)
Is there no message at the time when it is completely restored to the screen?
I have an NSWindow on which I set movableByWindowBackground = YES so that it can be moved by dragging it's contents. I then implement it's windowDidMove delegate method so I can detect when it moves, but at times I'm also animating this window. I'd like to detect when the window is moved due to a mouse drag vs an animation. Is there an easy way to do this?
When creating an NSWindow that has the NSResizableWindowMask flag set, Cocoa always draws a resize button in the bottom-right hand corner of the window. This button doesn't integrate very nicely with my custom drawn UI graphics so I'd like to know: Is there a way to tell Cocoa not to draw this button but still keep my window resizable?
I would like to start a slider action programmatically. So pressing on some text in a NSTextView that displays a slider also automatically starts the mousedown event on the slider so you can drag immediately instead of pressing twice. What approach should i take on this? Should i listen for global mouse events and then manually update the slider position, or can i somehow imitate the systems mouseDown / mouseMoved calls on the NSSlider?
I have a semi-transparent NSView subclass that acts as a kind of tooltip. When the tooltip is drawn on the screen it draws on top of a form and so it covers a couple of NSTextField's.
When I hover the mouse over the tooltip at the spots where a NSTextField exists, the cursor changes to the input style cursor.
How can I prevent the cursor from changing?
Overlapping views are not really supported very well in Cocoa and the behaviour is undefined.
Instead, your tooltip view should be in its own borderless window, large enough to contain your view. The tooltip window should be a child window of the main window it's attached to. To make a window a child of another window, you use the addChildWindow:ordered: method of NSWindow.
Child windows are attached to the parent window and will move with their parent window when the parent window moves. If you just open a new window without making it a child window, it will be "left behind" if the other window is moved.
To make a borderless window, pass NSBorderlessWindowMask as the styleMask to the initWithContentRect:styleMask:backing:defer: method of NSWindow.