Hi,
I'm developing a programmed GUI (using the nice GUI toolbox layout available on file exchange). What I want to do is to define minimal length and minimal height of the GUI figure to automatically resize it to avoid displaying problems when the user resize the screen.
To do so, I defined the following resize function callback associated to the figure GUI (I use nested functions, so it is not a variable problem)
function myGUI mainFig=figure('Position',[139 122 1204 675]); set(mainFig,'ResizeFcn',@Resize_clbk); min_length=1200; min_heigth=600;%[.....]
function Resize_clbk(hObject,Event) actual_pos=get(hObject,'Position'); if actual_pos(3)<min_length set(hObject,'Pos',[actual_pos(1:2) min_length actual_pos(4)]); end if actual_pos(4)<min_heigth set(hObject,'Pos',[actual_pos(1:3) min_heigth]); end endend
This function works nice when I resize the figure from both rigth and bottom borders of the window, but it doesn't works any time when I resize the window from the left or top border, or any corner.
Does anyone have a solution ?
Thank's in advance for your help ^^
Best Answer