I have a button cell that displays a graphic and then is duplicated horizontally and vertically based on numbers entered in a text field. My questions is, how to I reset the NSButtonCell image to nothing? I have added a button to clear and I am trying to use
myCell's setImage_()
but no luck.
Here is my code that works for setting the image and its parameters.
set myCell to current application's NSButtonCell's alloc()'s init()
myCell's setBordered_(0)
myCell's setBackgroundColor_(current application's NSColor's whiteColor())
set newImpoImage to NSImage's alloc()'s initWithContentsOfFile_(ImageFile) --(ImpoImageFill)
myCell's setImage_(newImpoImage)
myCell's setImageScaling_(0)
set stepVforPreview to (stepV's stringValue() as real)
set stepHforPreview to (stepH's stringValue() as real)
set StepMatrix to current application's NSMatrix's alloc()'s initWithFrame_mode_prototype_numberOfRows_numberOfColumns_({{0, 0}, {147, 142}}, 0, myCell, stepVforPreview, stepHforPreview)
StepMatrix's setAutosizesCells_(1) --Makes the cells fill the whole frame of the matrix set in the init method
myCell's setImageScaling_(0)
StepMatrix's setTarget_(me)
StepMatrix's setAction_("click")
StepMatrix's setBackgroundColor_(current application's NSColor's lightGrayColor())
StepMatrix's setDrawsBackground_(1)
cView's addSubview_(StepMatrix)