help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: callback functions for line object?


From: Michael Goffioul
Subject: Re: callback functions for line object?
Date: Wed, 9 May 2012 08:52:02 +0100

On Tue, May 8, 2012 at 11:18 PM, Antti Nissinen <address@hidden> wrote:
> Hi!
>
> I have been trying to get callbacks to work for a line in a figure since we
> have a need to get line handles picked up from the figure interactively
> (using Octave3.6.1_gcc4.6.2, windows 7 32bit)
>
> The manual says:
>
> "
> 15.4.4....
>
> The basic callback functions that are available for all graphics objects are
>
> - CreateFcn This is the callback that is called at the moment of the objects
> creation. It is not called if the object is altered in any way, and so it
> only makes sense to define this callback in the function call that defines
> the object. Callbacks that are added to CreateFcn later with the set
> function will never be executed.
> - DeleteFcn This is the callback that is called at the moment an object is
> deleted.
> - ButtonDownFcn This is the callback that is called if a mouse button is
> pressed while the pointer is over this object. Note, that the gnuplot
> interface does not respect this callback. "
>
> I have been trying the following procedure:
>
> * Create a simple callback function to detect triggering of callback funtion
>
> function mycallback (src, data)
>      fprintf ("Callback activated...\n");
> endfunction
>
> * Create a simple graph and get a handle for the line:
>
> h=plot([3,2,3,4,2])
>
> * Setting the callback function for the line
>
> set(h,'ButtonDownFcn',@mycallback)
>
> Now clicking the line does not fire the callback??
>
>
> On the otherhand if I will use the DeleteFcn callback it works correctly
>
> set(h,'DeleteFcn',@mycallback)
>
> => String is printed on the screen when delete(h) is applied.
>
> So what am I missing or misunderstanding with ButtonDownFcn
> callbackfunction?
> Thank you already beforehand for your help!

Selecting objects within an axes object is not supported yet. The
buttondownfcn callback only works for higher level objects, like axes
or figure objects.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]