[Drawkit] DKKnob
V1ru8
info at v1ru8.net
Mon Jun 15 07:16:48 PDT 2009
I attached the knob subclass to a layer not to the drawing. Added it
to the drawing now and everything works!
Thank you!
Thomas
On 15.06.2009, at 16:07, Graham Cox wrote:
>
> 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
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net
More information about the Drawkit
mailing list