Tabbing to buttons in a procedural view.

  • Dear Coco-dev People,

    I've implemented a number of NSTextField items and NSButton items PROCEDURALLY
    (without using IB) in a container view.  I successfully setup the
    firstResponder and tried setting up the nextKeyView chain, but the buttons are
    skipped when I tab sequentially through these items.

    (I've tried using different "setButtonType" parameters including
    NSToggleButton, NSSwitchButton and NSRadioButton.)

    I've looked at the Cocoa-dev archive but didn't come up with anything concrete.
    (Perhaps I missed something.)

    I'm guessing I need to subclass NSButton and/or NSButtonCell but I'm not sure
    exactly which methods to override.  I've tried several permutations but feel
    like I'm chasing my tail.

    A recipe showing how to do this or a pointer to example code that does this
    (procedurally) would really be appreciated!  (FWIW, I've already looked at
    ClockControl.)

    Sincere thanks.
    Joel Norvell

    __________________________________________________
    Do You Yahoo!?
    Tired of spam?  Yahoo! Mail has the best spam protection around
    http://mail.yahoo.com
  • On Thursday, October 05, 2006, at 03:04AM, Joel Norvell <frameworker...> wrote:

    > I've implemented a number of NSTextField items and NSButton items PROCEDURALLY
    > (without using IB) in a container view.  I successfully setup the
    > firstResponder and tried setting up the nextKeyView chain, but the buttons are
    > skipped when I tab sequentially through these items.

    Make sure full keyboard access in the 'keyboard & mouse' category is turned on in System Preferences.  As long as you've wired your next views correctly, it will all work.

    When full keyboard access is OFF, you'll only tab to controls that always need keyboard access (e.g. editable text, lists).  Otherwise, when ON, it will allow you to tab to every control that can optionally work with keyboard access (this is usually anything whose cell is derived from NSActionCell).

    --
    Rick Sharp
    Instant Interactive(tm)
previous month october 2006 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