Re: problem with NSMatrix
Re: problem with NSMatrix
- Subject: Re: problem with NSMatrix
- From: joie <email@hidden>
- Date: Sat, 6 Apr 2002 10:32:48 -0600
On Saturday, April 6, 2002, at 10:10 , Erik M. Buck wrote:
----- Original Message -----
From: "joie" <email@hidden>
then some code that acts upon the newly created cells. The console then
proceeds to yell at me. It turns out they aren't OSButtonCells at all
as
they don't recognize the selectors imageTag and setImageTag: as all
good
little OSButtonCells do. Very strange. Any ideas about this would be
much appreciated.
Or does renewRows:columns: only make NSButtonCells?
-renewRows:columns: probably reuses any already created cell
instances. You
probably want to set the cell class early before the matrix has
allocated
any of the cells. You may also be able to renewRows:0 columns:0 and
then
later renewRows:16 columns:16 to get the matrix to allocate new cell
instances.
You can also set a custom cell class in IB and possibly avoid all of
these
problems.
well, setting a custom cell class in IB wouldn't help, as at my
program's start, since there are a variable number of cells, i must set
it programatically- i only threw in the setCellClass: to illustrate that
I was using a custom NSButtonCell subclass...
I can't remove all the cells and respawn them, either, as this is a
level editor for a tile-based RPG, and to lose all one's work just
because one mis-sized the map would be quite frustrating.
to answer Sherm: OSButtonCell is a subclass of NSButtonCell.
to answer Andy: No, I've not tried a prototype, but I can't figure out
all the variables I should set to get a proper working button- i'll try
that, though, tomorrow, which is the next chance i'll get to play with
the code.
furthermore, one other question: Would it be more appropriate to
implement my own row/column-adding method? renewRows:columns: is quite
nice, but it seems to give me problems- i had started doing it my own
way, and would have done it like that had i not noticed
renewRows:columns in NSMatrix's specification.
-joie
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.