Table in a modal window
古いコメントを表示
Is there a way to use a table in a modal window? (quick comment to summarize findings, started from GUIDE play button it does not work as described, started from a command line and then it works)
I have a table in a modal window and it is not displaying the 'Data' from the text cell structure that I am setting into it.
Problem Example
1) Use Matlab Menu -> File -> New -> GUI
2) Select "Modal Question Dialog"
3) In GUIDE, Edit figure, stretch it larger, move a few things around
4) Add button and a table (default 4x2 is fine)
5) Add code to button call back to put data in the table
function pbTest_Callback(hObject, eventdata, handles)
theDdata{1,1} = 'test 11';
theDdata{1,2} = 'test 12';
set(handles.tblTest, 'Data', theDdata);
6) run program
7) click button
Table goes to one row but does not have data. When I checked the get(..'Data') the values were set. So it is simply not displaying the data. If you change this figure to 'normal' then it displays the text.
Changing the figure to normal:
1) In GUIDE, change WindowStyle to normal
2) In code, Comment out 'uiwait' in uiTestModal_OpeningFcn
% uiwait(handles.figure1);
3) comment out 'delete' in uiTestModal_OutputFcn
% delete(handles.figure1);
Now the table shows the data when the button is clicked.
MATLAB Version 7.13.0.564 (R2011b) Operating System: Microsoft Windows 7 Version 6.1 (Build 7601: Service Pack 1) Java VM Version: Java 1.6.0_29-b11 with Sun Microsystems Inc. Java HotSpot™ 64-Bit Server VM mixed mode
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!