Is there a way to adjust the delay time for hiding the automatically appearing scroll bar in Mac OS?
Currently, after scrolling a page, the scroll bar appears for less than a second before disappearing. If you are trying to grab the bar to manually adjust scroll position, that isn't a lot of time.
Is there some sort of terminal command that can double the length of the delay before the scroll bar hides again?
Related
On OS X (not iOS), I have an AVPlayerView in a window along with other controls. I am able to play it and have it go full screen with the button in the control bar. However, when I click the control bar to return to normal view (exiting full screen), the video and player disappear. The audio continues, but my view seems to have been lost.
Any ideas?
This was because I was setting the AVPlayerView as the contentView of an NSBox to make a "tab-like" interface. Using an NSTabView instead (without a border) works.
I have an app with a popover that appears on a status bar item. The thing is, when you click on the icon while you're in a full screen app, then move the mouse away from the menu bar to click on something in the popup, the menu bar moves up, and so does the popup. It's annoying.
Anyone know of any way to solve this? I've tried attaching an invisible menu to the popup, but I can't get the menu to be invisible.
Screenshot for clarity, the annoying part is where I wave my mouse around:
The popover window is moving because its parent window is the status item window, and when the parent window moves, the child moves with it. (Before I investigated this, I didn't even know Cocoa had parent and child windows.) I solved the problem with this code immediately after showing the popover:
NSWindow *popoverWindow = self.popup.contentViewController.view.window;
[popoverWindow.parentWindow removeChildWindow:popoverWindow];
Now, the menu bar still moves up, but at least the popup stays in the same place.
Either use Carbon events or watch for things happening to the menu bar (window of type NSStatusBarWindow):
Notifications of type
NSWindowDidChangeOcclusionStateNotification
NSWindowDidMoveNotification
NSWindowWillCloseNotification
NSWindowDidCloseNotification
with an object of class NSStatusBarWindow should give you enough information about the menu bar showing or hiding to add proper handling.
Super-hacky approach:
Custom window with some super-high window level to make it appear over the menu bar, then add a transparent custom view to the new window that catches and handles/blocks mouse clicks according to your needs.
Or:
Get the window instance the popover is using to display and track/handle NSWindowWillMoveNotification / NSWindowDidMoveNotification.
I converted #tbodt's answer to Swift 4 and confirmed that is resolves this issue:
let popoverWindow = popup.contentViewController.view.window as? NSWindow
popoverWindow?.parent?.removeChildWindow(popoverWindow!)
I built my project as a Tab Bar Application that utilizes the UITabBarController.
I've set all the auto layout constraints for all my subviews and it looks right in the preview. When my application first starts, I hide the tab bar in viewDidLoad. Once a button is clicked, I hide the view and show the tab bar.
My problem is that the constraints adjusted themselves to the hidden tool bar and everything shifts down the length of the height of the tab bar. If I go to the second tab and back to the first, the constraints are back to normal. Is there an easy way to deal with this? I need to find out how to either hide the tab bar in other way that doesn't compromise my constraints, or how to allow the first view to extend down over the tab bar. Please help.
Hiding tab bar liks so.
[self.tabBarController.tabBar setHidden:YES];
Oddly enough. When I go to set the vertical constraint to the bottom of the view, the distance to the bottom of the view is equal to the top of the tab bar even though the height of the tab bar is 50 px.
This only happens in firefox with a touch gesture device like the magic mouse or a macbook/macbook pro, but on some websites (some I've done and some I haven't) you can scroll horizontally even though there is no horizontal scrollbar, and there shouldn't be a scroll bar, so it's scrolling to stuff not supposed to be on the page.
http://starryeyedmusic.com/events - scroll to the right (that sidebar is positioned off the viewable page so as to not be seen)
I've also had this happen on some other websites, they work fine with normal mice or on chrome or opera with a trackpad or magic mouse.
-Danny
I did that using middle click and drag to see the example. On my laptop, I just use my horizontal scroll bar.
I expect that this is happening because the page is rendering larger than the space available. However, the CSS involved is specifically disallowing scroll bars, though scrolling still works.
I'm not precisely sure if I call that a bug or a feature.. I've found it nice to be able to scroll sideways on random things that are too large (overfilled iframes without scrollbars, for example).
Also, what is your 'question'?
How do I make one? I am kind of a newbie in Windows API. Is there some sort of manual for this sort of thing? I am specifically interested in a Core API. Thank you for any help.
There are three ways of doing scroll bars: A window's scroll bar; a scroll bar control; or a custom control.
Windows have scroll bars in the non-client (NC) area. These are part of the window frame, and as such they do not have their own window handle or anything.
Scroll bar controls are child window implementations of a scroll bar. Because they are child windows, they offer you a bit more flexibility. You could subclass or superclass one of these controls to implement "infinite" functionality.
The final option is a custom control: you just create your own scroll bar from scratch. Create a single child window, draw it yourself, handle all the mouse and keyboard input yourself, and implement the scroll bar messages yourself. This isn't actually as hard as it may sound.
I'd probably recommend superclassing a scroll bar control. Process the scroll messages in your own scroll bar wndproc, and fall back to the standard scroll bar wndproc for painting and such.
What do you mean with "infinite"?
If you mean a scroll bar where the user can never scroll to the ends, you have to handle the scroll bar's position change notifications and reset the position to the middle.