Ask a Question related to Mac Programming, Design and Development.
-
Simon Slavin #1
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
- (IBAction)itemClick:(id)sender
and my routine get called fine.
Now I need to change the number of cells in the matrix. In
fact I change the number several times, sometimes more, some-
times less. There is a maximum possible number but it's in the
hundreds. Changing the number works fine: the new cells are
drawn correctly and they highlight when I click on them.
Naturally, when I add new cells I also want them to call the
target routine. I tried to do this by using the first cell
to find its target, then setting the target of the other cells
to the same thing:
currentCell = [theMatrix cellAtRow:0 column:0];
theTarget = [currentCell target];
[...]
iterate through the cells:
[currentCell setTarget:theTarget];
end iteration
I know my iteration works because it sets other properties at
the same time. But none of the setTargets works. The top
few cells still call the routine but none of the new ones does.
What am I doing wrong ?
Simon Slavin Guest
-
change color of cells at hover
I want to build a navigation , without graphics, where the cell containing the link changes color when hovered over. I have applied a css style to... -
Change the first number
Hi All, I have a list of ID numbers that are populated in from a query into a cfselect. The numbers start a 1, but 1 is a fixed field that will... -
Why doesn't the CssClass property change the visual display of my datagrid cells?
Why doesn't the CssClass property change the visual display of my datagrid cells? Thanks for any insights. I'm primarily a developer of .NET... -
_Help: Batch Printing PDFs -- How to Change Target Folder
_Help: Batch Printing PDFs -- How to Change Target Folder I am batch printing multiple documents to PDF and want to print each PDF to the... -
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... -
Christian Witt #2
Re: Cocoa: NSMatrix, change number of cells, can't target new ones
[email]slavins@hearsay.demon.co.uk[/email]@localhost (Simon Slavin) wrote in message news:<BB8AAFF796683D2CE0@10.0.1.2>...
you have to set the action too:> currentCell = [theMatrix cellAtRow:0 column:0];
> theTarget = [currentCell target];
> [...]
> iterate through the cells:
> [currentCell setTarget:theTarget];
> end iteration
>
> I know my iteration works because it sets other properties at
> the same time. But none of the setTargets works. The top
> few cells still call the routine but none of the new ones does.
>
> What am I doing wrong ?
[currentCell setAction:@selector(itemClick:)];
Ciao
Christian
Christian Witt Guest
-
Simon Slavin #3
Re: Cocoa: NSMatrix, change number of cells, can't target new ones
In article <50052383.0309142349.51f927f2@posting.google.com >,
[email]christian.witt@epost.de[/email] (Christian Witt) wrote:
Thank you thank you thank you. Somehow I didn't think of that.>you have to set the action too:
>
>[currentCell setAction:@selector(itemClick:)];
I had target and action confused. That fixed it perfectly.
Mille Gracie.>Ciao
Oh. Herslichen Danke ?>Christian
Simon Slavin Guest



Reply With Quote

