[Drawkit] DKKnob
Graham Cox
graham.cox at bigpond.com
Mon Jun 15 07:07:38 PDT 2009
On 15/06/2009, at 11:42 PM, V1ru8 wrote:
> Thank you for the short introduction! But I still think I'm doing
> something wrong. My subclass of DKKnob overwrites the
> fillColourForKnobType method. But that method gets never called with
> the type kDKHotspotKnobType. And even if I allwasy return
> "blackColor" the hotspot is still yellow (yes I mean the one on
> DKImageShape).
OK, that's odd - I just tried changing this line in -
fillColourForKnobType:
case kDKHotspotKnobType:
result = [NSColor yellowColor];
break;
to return blue instead of yellow and it changed the colour as expected.
I think there is a bug that may be biting you here. Did you attach
your knob subclass to the layer or to the drawing? You can do either
but there was a bug with hotspot drawing that ignored any layer knobs
and uses only the drawing's. This is fixed for next time. Note that if
you insert the knobs at the drawing level they'll be used everywhere,
so in general I recommend that.
> Maybe if you redesign the DKKnob customization part some time. The
> idea of a class for every knob sounds nice. With a abstract factory
> patter I think that would be a nice idea.
Yes, this will probably happen (maybe not very soon, a it's more of a
tidying of the design than fixing major issues).
--Graham
More information about the Drawkit
mailing list