0

I have created a GUI and wish to set the position (and size) of the figure using the command;

set(hObject, 'Position', [4380, 1725, 900 650]);
guidata(hObject,handles)

When I place a break point at the first line and then continue the program, the handles update and the figure is in the correct position and of the right size, however without the breakpoint the position of the hObject (or handles.figure1) is not updated.

Any advice would be appreciated, thanks in advance.

Leo Chapiro
  • 13,678
  • 8
  • 61
  • 92
Tim
  • 1
  • 1
    Have you tried using drawnow after the set call? – Lukeclh Sep 05 '14 at 13:40
  • Where is this `set` command placed? Is this a GUIDE GUI? – sco1 Sep 05 '14 at 13:53
  • @excaza Hey, thanks for responding , the drawnow dosen't seem to help since the handles still aren't being updated. it is a guide GUI and the set is in; Executes just before Blurring_Cancers is made visible. function Blurring_Cancers_OpeningFcn(hObject, eventdata, handles, varargin) – Tim Sep 05 '14 at 15:05
  • If it helps anyone I found that by having a small pause i.e. pause(0.1) just before the set command the program worked as it should...if anyone has a more elegant solution I would really like to hear it, or if you could explain why the pause solution worked? – Tim Sep 08 '14 at 08:54

0 Answers0