Which GUI element does iCal use for calendar view? - cocoa

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.

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

Need advice on how to fix RBLPopover so that it will dynamically resize like NSPopover

RBLPopover is a Popover made by the Guys from Github that aims to mimimc NSPopover but fixes some of it's flaws, like canBecomeKeyWindow. It is part of the Rebel Framework they currently hosting on GitHub. I decided to use this Popover for my Statusbar Application and ran now into a problem. NSPopover is able to resize it's size dynamically and animated if it's shown and you use setContentSize. Then it will automatically resize animated to the newly given size. However, RBLPopover is not doing that. After 8 hours on looking into RBLPopover's Code I was not able to fix this, one reason will be lag of knowledge on my Part on how Views work internally in Detail.
The Code for RBLPopover can be found here:
https://github.com/github/Rebel/blob/master/Rebel/RBLPopover.m
Can someone give me a hint on how to fix this? I don't ask for code, just some advice/concept on how to achieve this. Is there some Method that is missing in it's parent class? I don't believe that showRelativeToRect:ofView:preferredEdge: is the right method to change. I believe that something more fundamental is missing but I don't get it.

NSPopover - hiding standard window possible?

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!

Switch Between Views in Cocoa (not Cocoa Touch)

It seems like there is a lot of online information regarding switching between views in Cocoa Touch, but not that many in "desktop" Cocoa. For an app I am creating, I am wondering the pros/cons of the methods (and please list the methods if you could), and which one people personally use/suggest. I don't think that using an invisible border NSTabView will do the trick for this specific app, but I value all your options. I will be changing the view with some buttons at the side as show in iPhoto, iTunes, and generally most Mac apps out there.
Thanks for any help.
EDIT: I have looked into using NSViewController, but am wondering what advice anyone has about how to use this/why not to use this.
Cathy Shive has created a framework called KTUIKit which was designed with single window applications modeled after iPhoto/iTunes/etc. The KTTabViewController class in particular may be of interest, as it provides a way of switching between an arbitrary number of subviews. They provide a formal way of dealing with nesting views, keeping the responder chain intact, and keeping various notifications properly observed/unobserved. There are also a series of blog posts describing some of the reasoning behind the design and how the classes work (the blog posts refer to them with an "XS" prefix instead of "KT", but they're basically the same thing).
Check out Brandon Walkin's excellent BWToolkit
NSViewController will work fine. I've used it for a very similar situation without any problems.

Gray NSTableView à la iTunes

How can I achieve the dark gray NSTableView look (used in iTunes, Delicious Library, etc.) in my own application?
I always thought this was an option in NSTableView (or NSTableHeaderView) but I never tried actually doing it.
After hours of searching, I'm pretty convinced that no such option exists, and that I need to do my own drawing.
Before going any further, I just want to make sure there isn't an (undocumented) API for this, and that I'm not missing something.
A good friend of mine created a whole control kit called BGHUDAppKit. It's for the new HUD stuff that Apple introduced a while ago. I believe his controls are themable, and they come with source. I personally haven't done anything with Cocoa, but he has and I know he could answer some questions. Unfortunately, he doesn't lurk here, so you'll have to contact him. I'll see if I can get him to come here. :)
Look at this page under iTableColumnHeader. Also there are many custom UI elements similar to Apple's

Resources