nextValidKeyView random failures

  • I have a UI with the following key loop:

    [help] --> [speech caricature] --> [stop drill] --> [NSTabView] -->
    (back to help)

    Now then, the tab view may contain items that are in the key loop.
    If it does, everything works as expected.  With full keyboard access
    on, I can tab amongst all the controls.

    However, when the NSTabView doesn't contain items that will
    participate in the key loop, I get a 50% failure.

    In success cases, here's the log output of my three buttons (first
    three things in the keyloop):

    object name (<object value>) --> <next key view object> (valid: <next
    valid key view object>)

    helpButton_II (<IIButton: 0x4f6c20>) --> <IIButton: 0x4c41c0> (valid:
    <IIButton: 0x4c41c0>)
    speechCaricature_II (<IIButton: 0x4c41c0>) --> <IIButton: 0x49d350>
    (valid: <IIButton: 0x49d350>)
    cancelButton_II (<IIButton: 0x49d350>) --> <NSTabView: 0x883da90>
    (valid: <IIButton: 0x4f6c20>)

    You can see that cancelButton_II (stop drill) has the tab view as the
    next key view, but that the help button is ultimately the next valid
    key view.

    In failure cases, here's the log output:

    helpButton_II (<IIButton: 0x880d8a0>) --> <IIButton: 0x45e900>
    (valid: <IIButton: 0x45e900>)
    speechCaricature_II (<IIButton: 0x45e900>) --> <IIButton: 0x8810e80>
    (valid: <IIButton: 0x8810e80>)
    cancelButton_II (<IIButton: 0x8810e80>) --> <NSTabView: 0x881eac0>
    (valid: <IIButton: 0x8810e80>)

    You can see here that the cancel button's next valid key view is itself.

    I do have a workaround for this specific case.  It happens that when
    I enter that UI, the tab view will either contain 'key-view-aware'
    objects, or it will not (i.e. the UI doesn't dynamically switch
    between the two).  Thus, upon entry to the UI, I can set the cancel
    button's nextKeyView to the appropriate object.

    However, this seems a bit hackish and I'd like to know the reason
    behind the random failures.  Also, I can definitely see myself
    running into this issue later on at which case I'll need a proper
    solution.

    Finally, this is all on 10.4.8 with a Universal app (running on
    PPC).  The objects in question are my own widgets (later I'll try to
    reproduce this using Aqua widgets).  I don't, however, have any
    special handling for tab keys; I let the framework do its thing.
    I've also cleared the key loop in IB a few times and wired things
    from scratch for this particular nib.  No change.

    ___________________________________________________________
    Ricky A. Sharp        mailto:<rsharp...>
    Instant Interactive(tm)  http://www.instantinteractive.com
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