When does the extent property of a uitable in a GUIDE-generated GUI get updated?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am programmatically setting the 'rowname', 'columnname', and 'data' properties of a uitable inside a function that is being called from within the 'openingfcn' of my gui. I am measuring the 'extent' property before and after 'data' property is set.
The name of my uitable is 'display_selected_ftrs_uitable.'
init_extent=get(handles.display_selected_ftrs_uitable,'extent');
set(handles.display_selected_ftrs_uitable,'rowname',row_headings,'columnname',column_headings,'data',init_data);
init_extent=get(handles.display_selected_ftrs_uitable,'extent');
Sure enough the 'extent' property is updated after setting the 'data' property. However, the updated value does not do justice (by having table extent much smaller than data) to the data.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/151332/image.png)
I do set the position property in accordance with the extent property (right below the code shown above) in the following manner:
init_position=get(handles.display_selected_ftrs_uitable,'position');
set(handles.display_selected_ftrs_uitable,'position',[init_position(1:2),init_extent(3:4)])
Interestingly, the 'extent' property of the uitable is updated again in the gui_mainfcn (which gets called right after exiting the gui openingfcn) at the following lines (231-237 in 2013a):
% Call openfig again to pick up the saved visibility or apply the
% one passed in from the P/V pairs
if ~gui_Exported
gui_hFigure = local_openfig(gui_State.gui_Name, 'reuse',gui_Visible);
elseif ~isempty(gui_VisibleInput)
set(gui_hFigure,'Visible',gui_VisibleInput);
end
This update is the correct one and does full justice to the data (I found this out by some sleuthing). But 'position' property is not updated accordingly and I end up with a crimped up table anyway.
Does anybody understand why the extent property gets updated in this manner? I tried doing refreshdata drawnow. They do not help.
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!