Setting popup menu value is not updating the variables in the workspace unless I manually click it
Show older comments
Hi, after using the forum for the past few months I have came across I problem I cannot find a solution to. Hope you can help :)
I have two popup menus, the first which is to select a vehicle. I have set that when a vehicle is chosen, the second popup menu will automatically go to the recommended tyre for this vehicle. I am able to make the second popup menu change to the correct selection upon picking a vehicle. However the variables associated with this selection is not updating unless I click on the second popup menu and select the tyre manually.
Can I automatically update all the variables in to the workspace for the second popup menu from only making a selection from the first popup menu. This is the simplified code, I am using set(handles) to set the selection for the second popup menu. But no variables are sent to workspace.
function popupmenu1_Callback(hObject, eventdata, handles)
popupmenu1 = get(handles.popupmenu1,'value');
switch popupmenu1
case 2
set(handles.popupmenu2,'value',2);
case 3
set(handles.popupmenu2,'value',3);
end
Hope this all makes sense. Thanks
1 Comment
KARNAM PRANAV
on 27 Nov 2020
Edited: KARNAM PRANAV
on 27 Nov 2020
hey, can you tell me how to change the second pop up menu with respect to the first one?
I have been working on state-district plot, so need to chnage district values in accordance to the state which is in the first pop up.
function Checkforchange(hObject,eventdata, handles)
tf=hasChanged(select1); % select1 is my selected value, i used get(handles.popupname,'string') to check what was selected.
if tf==1
setpopupString2(hObject,eventdata, handles) %calling function to set popup string
end
Is this correct?
thank you
Accepted Answer
More Answers (0)
Categories
Find more on Software Development in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!