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:
Error in Custom datatip string function

Subject: Error in Custom datatip string function

From: Nima Nikvand

Date: 31 Dec, 2012 04:13:14

Message: 1 of 3

Hello everyone,

I am using a custom datatip string function in my GUI, the call to the function is made in the following format:

set(dcmObj,'Enable','on',...
           'SnapToDataVertex','on', ...
           'DisplayStyle','datatip',...
           'UpdateFcn',@datatextbox);

where datatextbox is the custom datatip function and the following is it's format:

function [txt,pos] = datatextbox(~,event_obj)
        pos = get(event_obj,'Position');
         txt = {['Vector Length: ',num2str(pos(1))],['MOS: ',num2str(pos(2))]};
        myhandles = guidata(gcbo);
        sobj1= myhandles.sobj1;
        sobj2 = myhandles.sobj2;
        myhandles.txt = txt;
        set(myhandles.txt1,'string',txt);
        [imno,imind,vlength,ssim,axes] = lselection(sobj1,sobj2,pos);

However, I am getting a "Error in Custom datatip string function" error message when I add the last function (lselection) in my function definition. If I remove this function everything works alright. The lselection function works alright when used separately, I need to be able to pass and update the position information from this function and I am wondering what could be the problem and I appreciate any suggestions.

Subject: Error in Custom datatip string function

From: Nima Nikvand

Date: 31 Dec, 2012 06:25:06

Message: 2 of 3

Just a quick update to this post, I realized that the lselection function does not run at all, and I am not sure how to invoke it

"Nima Nikvand" <nnikvand@uwaterloo.ca> wrote in message <kbr3cq$osq$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
> I am using a custom datatip string function in my GUI, the call to the function is made in the following format:
>
> set(dcmObj,'Enable','on',...
> 'SnapToDataVertex','on', ...
> 'DisplayStyle','datatip',...
> 'UpdateFcn',@datatextbox);
>
> where datatextbox is the custom datatip function and the following is it's format:
>
> function [txt,pos] = datatextbox(~,event_obj)
> pos = get(event_obj,'Position');
> txt = {['Vector Length: ',num2str(pos(1))],['MOS: ',num2str(pos(2))]};
> myhandles = guidata(gcbo);
> sobj1= myhandles.sobj1;
> sobj2 = myhandles.sobj2;
> myhandles.txt = txt;
> set(myhandles.txt1,'string',txt);
> [imno,imind,vlength,ssim,axes] = lselection(sobj1,sobj2,pos);
>
> However, I am getting a "Error in Custom datatip string function" error message when I add the last function (lselection) in my function definition. If I remove this function everything works alright. The lselection function works alright when used separately, I need to be able to pass and update the position information from this function and I am wondering what could be the problem and I appreciate any suggestions.

Subject: Error in Custom datatip string function

From: chanansh@gmail.com

Date: 14 Jul, 2013 06:32:43

Message: 3 of 3

I have similar problem. sometimes datatip works sometime it doesn't. appear to be random

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