Ask a Question related to Mac Programming, Design and Development.
-
Alain Birtz #1
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
-
Cocoa: NSMatrix, change number of cells, can't target new ones
I have an NSMatrix of buttons. They work fine and the target is called when I click on one of them. I've set it up as just -... -
Cocoa: detecting click in NSMatrix
Okay, how the hell am I meant to do this ? I've set an IBAction as the target for my matrix and my routine does actually get called when the user... -
keyDown: in NSMatrix subclass
In <znu-55B7B3.11560309072003@news.fu-berlin.de> ZnU wrote: I presume you remembered to dick around with acceptsFirstResponder? When that... -
Tom Harrington #2
Re: setToolTip and NSMatrix of NSButton
In article <abz-3007031606530001@192.168.1.3>,
[email]abz@videotron.ca[/email] (Alain Birtz) wrote:
You're somewhat mistaken. An NSMatrix holds NSCell (or subclass)> 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"];
objects. If the matrix has a bunch of buttons, then it's got a bunch of
NSButtonCell objects, not NSButtons.
And that's where this error comes from. You retreived an NSButtonCell> 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 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



Reply With Quote

