R
R
Roman Elizarov2016-11-12 21:06:53
Cocoa
Roman Elizarov, 2016-11-12 21:06:53

How to force draw NSSliderCell?

There is a class inherited from NSSliderCell with an overridden drawBar(inside aRect: NSRect, flipped: Bool) method . I need, apparently, to call this method every time I change the parameter that I also added to the child class.
In the didSet of this parameter, I call the above method, but it does not work. The slider is updated (redrawn) only when its progress value (floatValue or doubleValue) changes, when the knob's position is changed. For certain, also at the task of maxValue - did not check. There is, of course, a wild workaroud - changing self.doubleValue to some meager value back and forth. Then the method is launched, apparently, from the didSet of this variable.
But this, of course, is not the case.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question