Matlab gui resize issue

  • #1
I have been trying the following to reposition my GUI (within the OpeningFcn):

h=get(handles.figure1,'Position');
set(0,'Units','normalized')
S = get(0,'screensize');
width = h(3);
height=h(4);
x = (S(3) - width)/2;
y = (S(4) - height)/2;
set(handles.figure1,'Position',[x,y,width,height]);

However this results in the Gui being position in an unexpected position. I am not sure why this is but the problem persists even if I replace set(handles.figure1,'Position',[x,y,width,height]) with set(handles.figure1,'Position',S) - I expected this change in code to result in a full screen gui however the position was offset (the width and height appeared correct though).
 

Answers and Replies

Related Threads on Matlab gui resize issue

  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
0
Views
6K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
1
Views
4K
Replies
1
Views
7K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
6
Views
22K
Replies
5
Views
969
  • Last Post
Replies
4
Views
890
Top