0

I have a class which inherets handle. This class manages (among others) a dropdown box, whose callback should call an instance function. The instance function looks like this:

function dropDownBox_Callback(src, eventData, obj)
    Redraw(obj);
end

I am trying to pass obj as parameter for the callback, as such:

uicontrol(obj.panel,'Style','popupmenu','CallBack', {@dropDownBox_Callback, obj});

However I get the error

Conversion to cell from double is not possible.

1 Answer 1

1

Are you sure that the error is coming from {@dropDownBox_Callback, obj}? Seems unlikely given the message text, and it's certainly supported.

Try the following:

h = uicontrol(obj.panel,'Style','popupmenu');
callbackFcn = {@dropDownBox_Callback, obj};
set(h, 'Callback', callbackFcn)

If there is an error, which line does it occur on?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.