0

I'm designing a simple Cocoa app. This is basically my second Cocoa app (despite being good at CocoaTouch), so I'm looking for an in-depth pros/cons analysis of 2 possible solutions for a window flipping problem.

What I'm trying to make is an utility app that sits in the menu bar and has its preferences o its “flip” side, Dashboard-style. It would flip from http://cl.ly/1G2M3J2c142Z0V3K0R2e to http://cl.ly/021z2v2h232x310z1g2q and back.

There are multiple questions on SO about the implementation of this effect:

I've looked at the example code there. Besides neither of them being as smooth as Dashboard widgets (but I'm yet to get to “making it smooth” part), they also share another trait -- they all flip between two different windows.

Now, coming from iOS, the way I started implementing it is to have a single window, but swap between two NSViews.

So what are the pros and cons of these two approaches, and why did multiple unrelated Cocoa developers pick the first one?

  1. Have two NSWindow's, and flip between them (hiding one and showing the other halfway through the flip).
  2. Have a single NSWindow, but two NSView's, and switch the views halfway through the flip.

Is it more convenient to have things separated into different windows in Cocoa? Is it because you can use NSWindowController to manage their lifecycle? Are people just used to using windows because pre-Core Animation you couldn't give views a CA layer? Any other reason/convenience I am missing?

Community
  • 1
  • 1
Andrey Tarantsov
  • 8,965
  • 7
  • 54
  • 58
  • This does not answer your question, but please don't flip the window on OS X... the preferences should appear in another window. Even on iPad things don't flip. – Yuji Jun 16 '11 at 21:25
  • @Yuji It's a very small utility, see the linked photoshop mockups. I believe that's the right UI for this task. Look at how nice the effect looks in Divvy and in dashboard widgets. A menubar utility is basically a widget too. – Andrey Tarantsov Jun 16 '11 at 21:30
  • I wrote my original comment after I saw the mockups... :p If it's basically a widget please put it in the dashboard. Small apps in the menubar shouldn't have UI/NSPopover to start with. It should just have standard menus, just like other menubar items. I don't want a different style of menus to pop up when I click the menubar items one by one from the right to the left. Of course you should use UI/NSPopover in the menubar items once Apple starts to use it on the standard menubar items. – Yuji Jun 16 '11 at 21:44
  • @Yuji Thanks for your concerns, I will think about this concept again with my designer. Still, as a long-time Mac user, I'm sure that's the UI I would want to use. – Andrey Tarantsov Jun 16 '11 at 22:01

1 Answers1

0

To the future generations: I believe people did it this way because they often flip between windows with different sizes, and then it's just less hassle to have them separate.

Also if you are looking for a good implementation, these guys nailed it: https://github.com/mizage/Flip-Animation

Andrey Tarantsov
  • 8,965
  • 7
  • 54
  • 58