Window Size of Guide-Program keeps altering

5 views (last 30 days)
Henri
Henri on 30 Jul 2011
Hello there.
I created a program in Guide and also specified this line in the m-file:
set(handles.figure1,'Position',[400 400 500 500]);
This is supposed to define the position (400 units away from lower left corner of the window) and the size of the window 500x500. This works perfectly on my computer (windows 7).
My coworker on the other hand always get problems with it. He's using both Win7 and Linux; on both computers the size of the window differs and the contents are only half visible. To specify this: There is a part on the top and the right missing form the window.
How do I fix this?
Thanks, Yours Henri

Answers (1)

Image Analyst
Image Analyst on 30 Jul 2011
Make sure the "units" property of all your controls is set to "normalized." Even then there may be slight differences in size and placement due to different video adapters and their settings.
  2 Comments
Henri
Henri on 30 Jul 2011
Thank you for your reply! I would like to know a bit more tough:
I had the units property set to "pixels". But with that set to "normalized" I get a new error: I have following code in the m-file:
handles.position1 = get(handles.figure1,'Position');
set(handles.figure1,'Position',(handles.position1 - [0 110 0 -100]));
This is supposed to change the size of the window, as i need it to do so. But now, when I use this command (by clicking a button) the window just dissapears (but is still in the windows task bar). When I try to run the program again, the window changes its size, but not like I want it to.
So how do things work with normalized units? what do I need to change? I would also really appreciate a link to tutorial if there is one.
Image Analyst
Image Analyst on 30 Jul 2011
All numbers need to be in the 0-1 range if you use normalized units. You're using 110 and 100 - that won't do since they're bigger than 1.

Sign in to comment.

Categories

Find more on App Building in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!