Macro question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Macro question

James Norman
Hello All,
I've developed a plugin that will manipulate an Roi, and I'm having
some trouble figuring a good way to install it.  My dilemma is that I
need to have an icon in the toolbar for it, but a macro isn't
sufficient because I need to change the cursor.  I can't change the
cursor because it looks like my macro is only run when I click on the
image.

Is there a way to execute some code when the macro tool is clicked on
the toolbar, before the Image is clicked?  This way I could set up the
code for the cursor before the mouse goes over the image region.

I also would need to get the Tool id of the marco that was installed.
This way I set the cursor only when my tool is running.

Let me know if there is another way of adding a tool to the Toolbar at
startup other then a macro and adding it to the startup macros.

Thanks,
JC Norman
Reply | Threaded
Open this post in threaded view
|

Re: Macro question

jmutterer
A tool that runs a macro when the tool's button is pressed
is called an "Action Tool" and is described at

http://rsb.info.nih.gov/ij/developer/macro/macros.html#tools

Jerome

On 3/29/07, James Norman <[hidden email]> wrote:

>
> Hello All,
> I've developed a plugin that will manipulate an Roi, and I'm having
> some trouble figuring a good way to install it.  My dilemma is that I
> need to have an icon in the toolbar for it, but a macro isn't
> sufficient because I need to change the cursor.  I can't change the
> cursor because it looks like my macro is only run when I click on the
> image.
>
> Is there a way to execute some code when the macro tool is clicked on
> the toolbar, before the Image is clicked?  This way I could set up the
> code for the cursor before the mouse goes over the image region.
>
> I also would need to get the Tool id of the marco that was installed.
> This way I set the cursor only when my tool is running.
>
> Let me know if there is another way of adding a tool to the Toolbar at
> startup other then a macro and adding it to the startup macros.
>
> Thanks,
> JC Norman
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro question

James Norman
I tried that method however the icon on the toolbar just toggles, and
does not stay depressed.  It also does not act as a tool, the current
tool is still selected, I need for the icon to behave as a tool and I
need notification when the tool is clicked, before the image is
clicked.  Can anyone think of any way to do this?

Thanks for any ideas you can provide.

JC Norman



On 3/29/07, jerome mutterer <[hidden email]> wrote:

> A tool that runs a macro when the tool's button is pressed
> is called an "Action Tool" and is described at
>
> http://rsb.info.nih.gov/ij/developer/macro/macros.html#tools
>
> Jerome
>
> On 3/29/07, James Norman <[hidden email]> wrote:
> >
> > Hello All,
> > I've developed a plugin that will manipulate an Roi, and I'm having
> > some trouble figuring a good way to install it.  My dilemma is that I
> > need to have an icon in the toolbar for it, but a macro isn't
> > sufficient because I need to change the cursor.  I can't change the
> > cursor because it looks like my macro is only run when I click on the
> > image.
> >
> > Is there a way to execute some code when the macro tool is clicked on
> > the toolbar, before the Image is clicked?  This way I could set up the
> > code for the cursor before the mouse goes over the image region.
> >
> > I also would need to get the Tool id of the marco that was installed.
> > This way I set the cursor only when my tool is running.
> >
> > Let me know if there is another way of adding a tool to the Toolbar at
> > startup other then a macro and adding it to the startup macros.
> >
> > Thanks,
> > JC Norman
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro question

jmutterer
James,

You could use the
macro "myMacro Tool Selected"{ } which will be run upon tool selection.

here is an example :

macro "my Tool - C000T2a12M"{
print ("image clicked");
}
macro "my Tool Selected"{
print ("my tool selected");
}


Jerome



On 3/29/07, James Norman <[hidden email]> wrote:

>
> I tried that method however the icon on the toolbar just toggles, and
> does not stay depressed.  It also does not act as a tool, the current
> tool is still selected, I need for the icon to behave as a tool and I
> need notification when the tool is clicked, before the image is
> clicked.  Can anyone think of any way to do this?
>
> Thanks for any ideas you can provide.
>
> JC Norman
>
>
>
> On 3/29/07, jerome mutterer <[hidden email]> wrote:
> > A tool that runs a macro when the tool's button is pressed
> > is called an "Action Tool" and is described at
> >
> > http://rsb.info.nih.gov/ij/developer/macro/macros.html#tools
> >
> > Jerome
> >
> > On 3/29/07, James Norman <[hidden email]> wrote:
> > >
> > > Hello All,
> > > I've developed a plugin that will manipulate an Roi, and I'm having
> > > some trouble figuring a good way to install it.  My dilemma is that I
> > > need to have an icon in the toolbar for it, but a macro isn't
> > > sufficient because I need to change the cursor.  I can't change the
> > > cursor because it looks like my macro is only run when I click on the
> > > image.
> > >
> > > Is there a way to execute some code when the macro tool is clicked on
> > > the toolbar, before the Image is clicked?  This way I could set up the
> > > code for the cursor before the mouse goes over the image region.
> > >
> > > I also would need to get the Tool id of the marco that was installed.
> > > This way I set the cursor only when my tool is running.
> > >
> > > Let me know if there is another way of adding a tool to the Toolbar at
> > > startup other then a macro and adding it to the startup macros.
> > >
> > > Thanks,
> > > JC Norman
> > >
> >
>