Set GUI to screen size: set(handle​s.figure1,​'Position'​,get(0, 'ScreenSize'));

2 ビュー (過去 30 日間)
Michael Lherbette
Michael Lherbette 2016 年 2 月 16 日
回答済み: Michael Lherbette 2016 年 2 月 19 日
Hello,
I am writing a GUI and as many user I want it to be maximize as soon as the user launch it. I used GUIDE to do it: my GUI has 3 panels with a toolbar, following these advices Create tab with matlab using panel .
I put this line to the opening function
set(handles.figure1,'units','norm','Position',[0 0 1 1]);
Expecting of course to get the gui maximize. Unfortunately it is not the case, see figure below:
Any ideas ?
ML

採用された回答

Michael Lherbette
Michael Lherbette 2016 年 2 月 19 日
Ok, I got the problem.
I was using the option proportional on Guide instead of user function. Then I added the code on the figure1_SizeChangedFcn which works.
Thank you !

その他の回答 (2 件)

Jan
Jan 2016 年 2 月 16 日
Try to use
set(handles.figure1, 'units', 'norm', 'OuterPosition', [0 0 1 1]);
  3 件のコメント
Jan
Jan 2016 年 2 月 18 日
What do you get for:
set(figure, 'units','norm','Position',[0 0 1 1]);
? If you get a full size figure, as expected, I guess, that you have any other code, perhaps in the ResizeFcn, which reduces the figure size. Use the debugger to step through the code line by line to identify the command, which changes the size.
Michael Lherbette
Michael Lherbette 2016 年 2 月 19 日
Exactly what I am thinking. It might come from the use of guide.

サインインしてコメントする。


Image Analyst
Image Analyst 2016 年 2 月 18 日
You're right - that doesn't do true maximization.
I use Yair Altman's maximizefigurewindow() function, attached.
  1 件のコメント
Michael Lherbette
Michael Lherbette 2016 年 2 月 19 日
I tried this code and as I said to Jan, I think it might comes from the use of guide for my gui. If I am running the maximize function, my gui appears to have the size of the panel I created on guide, not on my screen size.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by