[Drawkit] validateMenuItem:

Graham Cox graham.cox at bigpond.com
Tue Jun 23 04:52:33 PDT 2009


On 23/06/2009, at 9:42 PM, V1ru8 wrote:

> It's me again and again I have problems putting my head around  
> DrawKit.
> I'm trying to add some MenuItems on a Document based Application. So  
> I stared writing the validateMenuItem method for my MenuItem. I  
> placed it in my subclass of the DKViewController. I also tried it in  
> my subclass of the DKDrawingDocument but it gets never called. I  
> read the "BuIlt-in commands and features" part of the "Programmers  
> Reference" but I don't get it what I'm doing wrong. Can you help me?


Hi Thomas,

It's a bit hard to say what the problem might be from your  
description. Overriding it in a view controller and/or the document  
should work. Are you sure you have it exactly correctly spelt and with  
the same type for its argument and return type?

The flow of control of this method in DK is as follows:

view (first responder) -> its controller -> active layer -> selected  
object(s)
                       |-> (responder chain) -> document -> app...

the second path is only followed if nothing in the first path  
validates the item.

--Graham




More information about the Drawkit mailing list