[Drawkit] Keeping a drawing tool selected
Brad Larson
larson at sonoplot.com
Wed Jul 9 12:13:37 PDT 2008
That does the trick. It seemed like it should be that simple.
Out of curiosity, where does the current instance of DKToolController
reside? I'm currently sending the message to the first responder in
the following drawing tool selection code
[(DKToolController *)[[NSApp mainWindow] firstResponder]
setAutomaticallyRevertsToSelectionTool:NO];
DKDrawablePath *line = [[DKDrawablePath alloc] init];
[line setPathEditingMode:kGCPathCreateModeLineCreate];
[line setStyle:[[self drawing]
metadataObjectForKey:@"emptyFeatureStyle"]];
DKDrawingTool *tool = [[DKObjectCreationTool alloc]
initWithPrototypeObject:line];
[(DKToolController *)[[NSApp mainWindow] firstResponder]
setDrawingTool:tool]; // I could also use [tool set] here, which sends
the same message
and getting some instance of DKToolController to respond, but I don't
know where this instance exists. Again, this works just fine now, I'm
just trying to understand the inner workings.
On Jul 8, 2008, at 8:29 PM, Graham Cox wrote:
> This is a property of the tool controller. Call:
>
> [theToolController setAutomaticallyRevertsToSelectionTool:NO];
>
> the default setting is YES.
>
> cheers, Graham
>
>
>
>
> On 9 Jul 2008, at 11:23 am, Brad Larson wrote:
>
>> Is there a way to keep a drawing tool selected? That is, if I
>> select a line drawing tool and draw a line, I'd like to be able to
>> draw a line without re-selecting the line tool. Currently, it
>> looks like when any path is finished drawing, it sets the drawing
>> mode back to item selection.
>>
>> Honestly, I haven't taken that much time to look at DKDrawingTool
>> and there's probably a property to set that I'm missing, but I
>> thought I'd ask in case there was a quick and easy fix. Thanks
>> again.
>>
>> ______________________
>> Brad Larson
>> SonoPlot, Inc.
>> 3030 Laura Lane, Suite 120
>> Middleton, WI 53562
>>
>>
>>
>> _______________________________________________
>> Drawkit mailing list
>> Drawkit at lists.apptree.net
>> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net
>
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net
______________________
Brad Larson
SonoPlot, Inc.
3030 Laura Lane, Suite 120
Middleton, WI 53562
More information about the Drawkit
mailing list