Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Dynamically alter datatip behavior

Subject: Dynamically alter datatip behavior

From: Matt J

Date: 8 Oct, 2012 21:33:27

Message: 1 of 3

I have a GUI containing an image axis and some radio buttons. I want the behavior/appearance of new figure datatips introduced into the image window to be determined based on the state of the radio buttons.

When a different radio button is selected, I update the datacursormode object's UpdateFcn. However, I find that it doesn't take effect on how new datatips look, if there are prior data tips already present in the figure. After I delete the prior datatips manually, the new UpdateFcn does kick in and things work fine. Why is this necessary?

Also, if it's absolutely necessary to delete all prior data tips to make this work, how do I do so programmatically?

Subject: Dynamically alter datatip behavior

From: Steven_Lord

Date: 9 Oct, 2012 14:01:16

Message: 2 of 3



"Matt J " <mattjacREMOVE@THISieee.spam> wrote in message
news:k4vgr7$q4g$1@newscl01ah.mathworks.com...
> I have a GUI containing an image axis and some radio buttons. I want the
> behavior/appearance of new figure datatips introduced into the image
> window to be determined based on the state of the radio buttons.
>
> When a different radio button is selected, I update the datacursormode
> object's UpdateFcn. However, I find that it doesn't take effect on how new
> datatips look, if there are prior data tips already present in the figure.
> After I delete the prior datatips manually, the new UpdateFcn does kick in
> and things work fine. Why is this necessary?
>
> Also, if it's absolutely necessary to delete all prior data tips to make
> this work, how do I do so programmatically?

You could have the UpdateFcn query the state of the radio button itself and
decide what information to display based on that state.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Dynamically alter datatip behavior

From: Matt J

Date: 9 Oct, 2012 15:25:08

Message: 3 of 3

"Steven_Lord" <slord@mathworks.com> wrote in message <k51anb$bs1$1@newscl01ah.mathworks.com>...
>
> You could have the UpdateFcn query the state of the radio button itself and
> decide what information to display based on that state.
================
 

Yeah, that's what I ended up doing. Thanks.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us