When creating a UiTable and trying to display a pop-up menu in a cell, the point down arrow does not appear.
9 ビュー (過去 30 日間)
古いコメントを表示
I am trying to create a drop down menu with different options in a cell for UITable. But when the GUI appears the cell looks exactly as the others and only when i double click it the option menu (and the down arrow) appears.
My code is:
d = {'LogStart', 0.2, 'Log End', 800, 3000};
ColumnNames = {'BGGas top Zone name', 'BGGas value %',...
'BGGas base zone name', 'BGGas top zone depth',...
'BGGas base zone depth'};
zones = {'LogStart', 'Neogene', 'Paleogene', 'Cretaceous', 'Jurassic',...
'Triassic', 'Permian', 'Carboniferous', 'Devonian', 'Silurian',...
'Ordivician', 'Cambrian'};
fig = uifigure('Name', 'Enter Background Gas Value',...
'CloseRequestFcn',@Parent_closefcn);
%-------Table------
uit = uitable(fig);
uit.Position(1:2) = [10,150];
uit.Position(3:4) = [fig.Position(3)-20, fig.Position(4)-220];
uit.ColumnSortable = false;
uit.RowName = 'numbered';
uit.ColumnName = ColumnNames;
uit.Data = d;
uit.ColumnFormat = {zones, 'numeric', 'char', 'numeric', 'numeric'};
uit.ColumnEditable = [true true false false false true];
When running my code my GUI looks like this:

And when double clicking:

Any idea why the drop down menu arrow is not appearing?
Thank you in advance.
2 件のコメント
Debasish Samal
2020 年 11 月 13 日
Hi Alejandro!
As far as I know, you have to click once on the particular cell you want to edit and click a second time for the drop down menu to appear and select an option from the menu.
I found an answer with a workaround which might help you here. Please refer to the MATLAB Answer below:
I have not tried it myself. Please try and see if it works for you.
Thanks.
-Debasish
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!