Professional Web Applications Themes

keyDown: in NSMatrix subclass - Mac Programming

Removed by Administrator...

  1. Moderated Post

    Default Re: keyDown: in NSMatrix subclass

    Removed by Administrator
    matt neuburg Guest
    Moderated Post

  2. #2

    Default Re: keyDown: in NSMatrix subclass

    In <znu-27DE66.09010313072003news.fu-berlin.de> ZnU wrote:
    > I stuck:
    >
    > [[self window] makeFirstResponder:self];
    >
    > in acceptsFirstResponder. This seems to work.
    That seems really dangerous to me. Are you quite sure that you couldn't
    get the desired result by returning YES from both acceptFirstResponder
    and becomeFirstResponder, which is the canonical way to do it? m.


    --
    matt neuburg, phd = [email]matttidbits.com[/email], [url]http://www.tidbits.com/matt[/url]
    REALbasic: The Definitive Guide! 2nd edition!
    [url]http://www.amazon.com/exec/obidos/ASIN/0596001770/somethingsbymatt[/url]
    Subscribe to TidBITS. It's free and smart.
    matt neuburg Guest

  3. #3

    Default Re: keyDown: in NSMatrix subclass

    In article <20030713091723225-0700news.la.sbcglobal.net>,
    matt neuburg <matttidbits.com> wrote:
    > In <znu-27DE66.09010313072003news.fu-berlin.de> ZnU wrote:
    > > I stuck:
    > >
    > > [[self window] makeFirstResponder:self];
    > >
    > > in acceptsFirstResponder. This seems to work.
    >
    > That seems really dangerous to me. Are you quite sure that you couldn't
    > get the desired result by returning YES from both acceptFirstResponder
    > and becomeFirstResponder, which is the canonical way to do it? m.
    Positive. If I simply do that, becomeFirstResponder never even gets
    called.

    --
    "First, let me make it very clear, poor people aren't necessarily killers. Just
    because you happen to be not rich doesn't mean you're willing to kill."
    -- George W. Bush in Washington, D.C. on May 19, 2003
    ZnU Guest

  4. #4

    Default Re: keyDown: in NSMatrix subclass

    In article <20030715082836994-0700news.la.sbcglobal.net>,
    matt neuburg <matttidbits.com> wrote:
    > In <znu-E93F54.10495515072003news.fu-berlin.de> ZnU wrote:
    > > In article <20030713091723225-0700news.la.sbcglobal.net>,
    > > matt neuburg <matttidbits.com> wrote:
    > >
    > >> In <znu-27DE66.09010313072003news.fu-berlin.de> ZnU wrote:
    > >> > I stuck:
    > >> >
    > >> > [[self window] makeFirstResponder:self];
    > >> >
    > >> > in acceptsFirstResponder. This seems to work.
    > >>
    > >> That seems really dangerous to me. Are you quite sure that you
    > >> couldn't get the desired result by returning YES from both
    > >> acceptFirstResponder and becomeFirstResponder, which is the
    > >> canonical way to do it? m.
    > >
    > > Positive. If I simply do that, becomeFirstResponder never even gets
    > > called.
    >
    > But that's only because you're not doing anything to cause the NSMatrix
    > subclass to be the first responder in the first place! It doesn't happen
    > all by itself, you know.
    >
    > In other words, what I'm saying is, don't call makeFirstResponder inside
    > acceptsFirstResponder - that's a sort of circular corruption of the
    > framework - but do call it! In your window controller's awakeFromNib,
    > for example, say something like this:
    >
    > [[myMatrix window] makeFirstResponder: myMatrix];
    That works initially, of course. But if another view becomes the first
    responder, there's no way to make the matrix the first responder again;
    when it's clicked, acceptsFirstResponder gets called and then... nothing.
    I suppose I could send the makeFirstResponder message from mouseDown
    rather than from acceptsFirstResponder, but that seems functionally
    identical in this case; there appears to be a one-to-one correspondence
    between clicks on the view and calls to acceptsFirstResponder.

    [snip]

    --
    "First, let me make it very clear, poor people aren't necessarily killers. Just
    because you happen to be not rich doesn't mean you're willing to kill."
    -- George W. Bush in Washington, D.C. on May 19, 2003
    ZnU Guest

Similar Threads

  1. keyDown
    By Anne in forum ASP.NET
    Replies: 9
    Last Post: May 31st, 04:02 PM
  2. Cocoa: NSMatrix, change number of cells, can't target new ones
    By Simon Slavin in forum Mac Programming
    Replies: 2
    Last Post: September 16th, 10:58 PM
  3. Cocoa: detecting click in NSMatrix
    By Simon Slavin in forum Mac Programming
    Replies: 0
    Last Post: September 7th, 11:08 PM
  4. setToolTip and NSMatrix of NSButton
    By Alain Birtz in forum Mac Programming
    Replies: 1
    Last Post: July 30th, 08:38 PM
  5. keyDown & keyUp?????
    By Nicollini webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 2
    Last Post: July 11th, 12:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139