NSPopover - hiding standard window possible? - macos

In my Mac app, I want to use a NSPopover, activated by a NSStatusItem. Activating works like a charm, but I would like to get rid of the standard window (white or HUD), that is provided by the NSPopover, and use my own view instead. Does anyone know if that is possible?
Thanks

no, it is not possible -- we tried hard and ended up reverting to the 10.7 way of using a custom class.. check MAAttachedWindow
well with enough swizzling and posing it'd be possible of course... but that is very evil and at least as much work as your own class!

Related

Custom NSTabView with lefttab

I want to make a NSTabView like CleanMyMac or other application.
Never tried to customize NSOutlineView or NSTableView that heavily but I doubt it would get close enough to the custom (read: non-standard) behaviour you're looking for..
You can check for third party, Open Source controls that implement something similar. There are a couple of controls listed on Cocoa Controls that come pretty close.
Cocoa Controls is good idea.
Maybe this is a nice starting point:
https://github.com/monyschuk/LITabControl

Disable All Interaction with a Cocoa WebView

I'm having difficulty in using a WebView that is being used purely to display a preview of a website - and I want to ignore all/any interactions the user may try to make with it.
I've already tried Cocoa webView - Disable all interaction to no avail; you can still easily spam-click and it will recognise the presses. (at least there's no context menu)
This one seems overkill; Disable a WebKit WebView - there must be an easier way.
In iOS I know exactly how to solve this, but as a Cocoa newcomer I am stumped - does anyone have any suggestions or better ways to achieve this? Or dump a transparent NSView on top and gobble up interactions? (tried this as well by subclassing an NSView, also to no effect)
Whole project is in IB currently, if this makes any difference.
I think you want to implement a WebPolicy Delegate and have it deny navigation events.

How to make an NSPanel immovable

Hey all, quick question that has been bugging me about NSPanel. I like the look of The NSPanel HUD but for the project I am doing I need the Panel to not be moved. Does anyone know of any possible solutions to make it were my NSPanel cannot be moved at all but maintain its buttons interactivity? I've been searching for any questions similar to this for awhile now. Any insight on the issue would be helpful! Thanks.
Don't forget to look in superclasses. A panel is a kind of window, and since Mac OS X 10.6, it's possible to set a window's movable property to NO.
I'm with Dave DeLong, though: I hope you have a good reason to break this functionality. Users expect to be able to move windows, especially those with title bars and HUD windows by their backgrounds, out of their way. And remember, you're not the only application on the system; the user may have something important to get to in a window in another application.

Globally hide mouse cursor in Cocoa/Carbon?

Is there a way to globally hide the mouse cursor for all apps in Cocoa (or Carbon)? Or at least replace it with something else?
EDIT: Thanks for the input guys, but turns out Daniel Jalkut found the solution a while ago :) http://lists.apple.com/archives/carbon-dev/2006/Jan/msg00555.html
You are looking for CGDisplayHideCursor, which is part of the Quartz Display Services API.
Check out: http://developer.apple.com/legacy/mac/library/samplecode/CarbonCocoa_PictureCursor/listing2.html
It's an old sample, but probably still works.
I expect that you're going to be limited to your application window, however. If you want to hide it for everyone you will probably have to make your window cover the screen.
Fun fact: The old toolbox function was simply "HideCursor()".
just add this to your code:
CGDisplayHideCursor (kCGNullDirectDisplay);
No, I don't believe there's a way of doing what you want, short of showing a full screen window and then obscuring absolutely everything on the desktop. That would also prevent e.g. keystrokes being sent to the right application and the like.

Which GUI element does iCal use for calendar view?

I’m writing a simple iCal-like app in Cocoa that I’d like to resemble the main view of iCal.
Does anyone know which GUI element (i.e. NSWhatever) was used to create the Month-view (this thing: http://skitch.com/edwardog/b38ba/ical)?
Thanks!
PS – A hint at figuring this sort of thing out for myself would also be well appreciated; I’ve got a feeling that the answer lies somewhere in .nib, but after poking around I didn’t have much luck.
CalendarWindow.nib, "Window".
Looks like it's all custom views I'm afraid.
The main calendar view must be a custom subclass of NSView, with custom drawing in the overridden drawRect: method.
If you really feel like poking around in running applications, check out F-Script Anywhere.
I'm not claiming that iCal uses it, but you might try NSDatePicker, which supports a calendar style.

Resources