tool activate()

Boudewijn Rempt boud at valdyas.org
Mon Mar 21 10:50:48 CET 2005


On Monday 21 March 2005 10:09, Casper Boemann wrote:
> On Monday 21 March 2005 10:00, Boudewijn Rempt wrote:
> > On Monday 21 March 2005 09:09, Casper Boemann wrote:
> > > activate() is called twice (along with -6 times update, as if the tool
> > > is installed twice), when I click on its icon the first time, but then
> > > it isn't called anymore, even if I switch to say a brush and back.
> >
> > Every tool _is_ installed three times, once for the mouse, once for the
> > stylus and once for the eraser end of the stylus.
>
> ok
>
> btw I did a little error so now, the activate is called (still twice) each
> time I click the icon
>

But you can now switch between tools again?

> > The problem you describe above looks a lot like the problems I initially
> > had when I made the crop tool a plugin. You need to be careful which
> > action collection you add the tool action to. Did you take the crop tool
> > as a template? Is your new tool a plugin?
>
> Yes I took crop as a template, and hence it's a plugin
>
> > > Also there is a clean() method, which seems to do what I want
> > > deactivate() to be.
> >
> > ??? In which file?
>
> in core/tool/kis_tool.h
> and implementeted in kis_tool_non_paint to do nothing

Yes, I think that the clear() (that's what you meant, right?) were intended 
for what you need: remove the guides, rubber bands or anything else from the
display when the tool is done. However, I'm not sure. This part of the design
dates from Patrick Julien's days and I only hacked on it when I was still 
fumbling my way around Krita and C++, and it's been a long time...

-- 
Boudewijn Rempt 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20050321/0a0eac46/attachment.pgp


More information about the kimageshop mailing list