Turn non-resizeable figure into resizeable figure?
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, I created a GUI with 2 axes, which has to be not resizeable. In addition, I would like to install a button to save the GUI as a resizeable figure. My attempt was to use copyobj to copy the figure into a new window and then set Resize to 'on', i.e.
newfig = copyobj (gcf,0);
set(gcf, 'Resize', on)
Matlab creates a new figure, which however still is not resizeable. How do I reactivate the option to resize the window of the figure?
Thank you!
0 Commenti
Risposte (3)
Orion
il 18 Nov 2014
Modificato: Orion
il 18 Nov 2014
Hi,
In your callback function, don't use gcf, but the handle of your figure ( figure1 by default)
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
newfig = copyobj(handles.figure1,0); % copy the the figure to an exact new one
set(newfig, 'Resize', 'on'); % the copy is resizable
0 Commenti
Frank
il 21 Nov 2014
Modificato: Frank
il 21 Nov 2014
2 Commenti
Orion
il 21 Nov 2014
Weird. It works for me (R2014a), and I'm pretty sure, this line works for previous releases (I don't know for the 2014b)
Anymay, try this line with a simple gui with just an axe and a button. If it works, then the problem comes from your gui, in which you should have configure something, that prevent resizing.
Vedere anche
Categorie
Scopri di più su Graphics Object Identification 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!