How to set my gui width as the screen width

1 view (last 30 days)
Hi, I try to set the width of my Gui to the user screen width.
I try: ScreenDimensions = get(0,'ScreenSize'); GuiDimensions = [0 0 ScreenDimensions(4) ScreenDimensions(3)]; set(myGui,'Position',GuiDimensions);
where 'myGui' is the background figure of the gui. It's dont work... i try eval and cast to int.
any idea?
Thanks

Accepted Answer

Sean de Wolski
Sean de Wolski on 14 Dec 2011
Just use normalized figure units (range from 0 to 1) and it'll take up the whole screen:
figure('units','norm','Position',[0 0 1 1]);
To get what you have above working (and you're almost there!) you'd have to set the figure units to pixels because that's what the screen size is measured in.

More Answers (0)

Categories

Find more on Interactive Control and Callbacks 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!