retrieving data from GUI table with pop-up menu
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi.
I'm creating a GUI using GUIDE that has a table, whose first column format is a pop-up menu. In each pop-up menu there's a line "new label".
I want that every time the user picks "new label", a new dialog box will open, that would allow entering a new string and update the label list stored in handles.
I'm able to do something with cellSelectionCallback, but it only executes when I select a cell, not when I pick a value from the cell's pop-up menu. It seems the popupmenu1_callback never fires.
Also, there's not handle to a pop-up menu in the handles.
Attached is the code section in the cellSelection callback:
function uitable1_CellSelectionCallback(hObject, eventdata, handles)
% hObject handle to uitable1 (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.TABLE)
% Indices: row and column indices of the cell(s) currently selecteds
% handles structure with handles and user data (see GUIDATA)
CellChoice = eventdata.Indices;
Tiss = eventdata.Source.Data; % not working yet. unable to refer the new label choice as an event
TisChoice = Tiss{CellChoice};
if strcmp(TisChoice,'new label')
NewLabel = inputdlg('Please Enter the New Label Name');
handles.TissueDataBase(end+1) = NewLabel;
handles.uitable1.ColumnFormat = {handles.TissueDataBase(2,:),[]};
end
Kind regards,
Ariel
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Environment Customization in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!