Function Handle Callbacks and appdata

1 回表示 (過去 30 日間)
Chad
Chad 2013 年 8 月 13 日
I am having a hard time updating a list from a function callback. For instance, I pass the handle of a line to the function line_edit and the user selects a color to change the line. That all works fine but I cant add the new color value to a listbox for display in my GUI
Here are some snippets of code:
line_handle = plot(gca,f,pxx);
set(line_handle,'ButtonDownFcn',@line_edit);
function line_edit(src,evnt)
color_current = str2num(get(handles.color_table,'String'))
%%I use ismember and find to find where user_selected_color and current_color have matching rows. %%then I would want to update color_table but the handles funcions arent defined
Summary: How do I pass the handle of another object into my function? how and where should i store this data
  1 件のコメント
Chad
Chad 2013 年 8 月 13 日
Figured it out. used findobj inside the function

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Identification についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by