Professional Web Applications Themes

setToolTip and NSMatrix of NSButton - Mac Programming

What is wrong with this code: matrix_of_but is a NSMatrix of NSButton NSButton *but; but = [matrix_of_but cellAtRow:0 column:0]; [but setToolTip: "tool"]; CW report this error (for the last line) .... Unknown class Selection_View in Interface Builder file. ....*** -[NSButtonCell setToolTip:]: selector not recognized ....An uncaught exception was raised ....*** Uncaught exception: <NSInvalidArgumentException> *** -[NSButtonCell setToolTip:]: selector not recognized...

  1. #1

    Default setToolTip and NSMatrix of NSButton

    What is wrong with this code:

    matrix_of_but is a NSMatrix of NSButton
    NSButton *but;

    but = [matrix_of_but cellAtRow:0 column:0];
    [but setToolTip: "tool"];


    CW report this error (for the last line)

    .... Unknown class Selection_View in Interface Builder file.
    ....*** -[NSButtonCell setToolTip:]: selector not recognized
    ....An uncaught exception was raised
    ....*** Uncaught exception: <NSInvalidArgumentException> *** -[NSButtonCell
    setToolTip:]: selector not recognized
    Alain Birtz Guest

  2. #2

    Default Re: setToolTip and NSMatrix of NSButton

    In article <abz-3007031606530001192.168.1.3>,
    [email]abzvideotron.ca[/email] (Alain Birtz) wrote:
    > What is wrong with this code:
    >
    > matrix_of_but is a NSMatrix of NSButton
    > NSButton *but;
    >
    > but = [matrix_of_but cellAtRow:0 column:0];
    > [but setToolTip: "tool"];
    You're somewhat mistaken. An NSMatrix holds NSCell (or subclass)
    objects. If the matrix has a bunch of buttons, then it's got a bunch of
    NSButtonCell objects, not NSButtons.
    > CW report this error (for the last line)
    >
    > ... Unknown class Selection_View in Interface Builder file.
    > ...*** -[NSButtonCell setToolTip:]: selector not recognized
    > ...An uncaught exception was raised
    > ...*** Uncaught exception: <NSInvalidArgumentException> *** -[NSButtonCell
    > setToolTip:]: selector not recognized
    And that's where this error comes from. You retreived an NSButtonCell
    and called -setToolTip on it. But NSButtonCell does not implement
    -setToolTip.

    You probably want to be using -[NSMatrix setToolTip:forCell].

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See [url]http://www.atomicbird.com/[/url]
    Tom Harrington Guest

Similar Threads

  1. 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
  2. Cocoa: detecting click in NSMatrix
    By Simon Slavin in forum Mac Programming
    Replies: 0
    Last Post: September 7th, 11:08 PM
  3. keyDown: in NSMatrix subclass
    By matt neuburg in forum Mac Programming
    Replies: 3
    Last Post: July 16th, 12:05 AM

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