Animating NSTabView

  • I'd like to animate my tab view when it switches tabs. I thought this
    was supposed to be easy with the Core Animation changes in Leopard,
    but I can't figure it out. If turn on the layers in IB 3 and set the
    orderIn transition effect I get nothing. I've tried various things but
    can't get anything to happen. Can someone tell me how to do this? Does
    NSTabView not support animating transitions between tabs? Can someone
    point me to a good tutorial on using Core Animation with Cocoa views?

    Thanks,

    Rod Schmidt
    www.infinitenil.com
  • I looked into this earlier, and from what I understand of the
    situation, the orderIn and OrderOut transitions are when subviews are
    created or removed from subview tree.  So, unless you are adding or
    removing views, you aren't going to see any animations just swapping
    between the views.

    I found an example project using NSViewAnimation somewhere, but I
    can't recall just where I found it.  This had a controller with
    outlets for a container view and two subviews which it swapped in and
    out.  Relatively basic in concept, but was fairly ugly code with the
    viewanimation stuff (but is Tiger compatible).

    Matt
    <matt...>
    http://www.macfanatic.net/blog/

    On Dec 24, 2007, at 2:26 PM, <cocoa-dev-request...> wrote:

    > Message: 14
    > Date: Mon, 24 Dec 2007 12:24:20 -0700
    > From: Rod Schmidt <rschmidt...>
    > Subject: Animating NSTabView
    > To: <cocoa-dev...>
    > Message-ID: <4933426E-5908-4F30-8CB2-A1B13C9ACCBD...>
    > Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
    >
    > I'd like to animate my tab view when it switches tabs. I thought this
    > was supposed to be easy with the Core Animation changes in Leopard,
    > but I can't figure it out. If turn on the layers in IB 3 and set the
    > orderIn transition effect I get nothing. I've tried various things but
    > can't get anything to happen. Can someone tell me how to do this? Does
    > NSTabView not support animating transitions between tabs? Can someone
    > point me to a good tutorial on using Core Animation with Cocoa views?
    >
    > Thanks,
    >
    > Rod Schmidt
    > www.infinitenil.com
  • On Mon, 24 Dec 2007 12:24:20 -0700, Rod Schmidt <rschmidt...>
    said:
    > Can someone
    > point me to a good tutorial on using Core Animation with Cocoa views?

    I found this very helpful for "simple" animation:

    http://developer.apple.com/samplecode/BasicCocoaAnimations/listing7.html

    The example is useful for what it doesn't show as much as what it does.
    Notice, for instance, that there are no editable NSTextFields in any
    layer-backed views (because they are drawn incorrectly), and that there are
    no tab views in the story (because, as you have found, they do not animate
    themselves). The example provides an alternative approach, by swapping in
    views by hand; that approach *does* animate. m.

    --
    matt neuburg, phd = <matt...>, <http://www.tidbits.com/matt/>
    A fool + a tool + an autorelease pool = cool!
    One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
    AppleScript: the Definitive Guide - Second Edition!
    <http://www.amazon.com/gp/product/0596102119>
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today