The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to make a GUI that works in all display modes?
Replies: 2   Last Post: Aug 21, 2013 1:37 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Jerry Gregoire

Posts: 10
Registered: 3/30/11
Re: How to make a GUI that works in all display modes?
Posted: Aug 21, 2013 1:37 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Jordan Rosenthal" <> wrote in message <8240pa$96$>...
> Bruce,
> Use get(0,'Screensize') to return the resolution. For the font size, use
> get(0,'DefaultAxesFontSize'), get(0,'DefaultTextFontSize'), and
> get(0,'DefaultUIControlFontSize'). If you want the defaults for a
> particular figure, replace the 0 with the handle for the figure.
> Here is one approach to your problem that works okay. If you are sure you
> will only be using a PC, then you can change all object units to normalized.
> Either save the figure with normalized units, or use the following code
> which will convert the units for you.
> hAxes = findall(hFig,'type','axes');
> hText = findall(hAxes,'type','text');
> hUIControls = findall(gcf,'type','uicontrol');
> set([hAxes; hText;
> hUIControls],'units','normalized','fontunits','normalized');
> Then you can just resize the figure, and all the objects will resize
> accordingly. You can, for example, use the screen resolution information to
> adjust your figure to take up a certain percentage of the screen.
> If you want the code to look good on multiple operating systems, then,
> depending on your GUI, you may want to use 'character' units for the layout
> and then either convert to normalized at runtime or write your own resize
> function that resizes the objects directly in 'character' units.
> Hope that helped,
> - Jordan
> "Bruce Lee" <> wrote in message

> > Is there an easy way to create a GUI that displays properly in all display
> > modes? I develop in Windows 98 at 1024x768 with large fonts, but if I run
> > the file on another PC at a different resolution the window is too large

> to
> > fit on the screen, or the buttons are misplaced, etc. etc.
> >
> > Do I have to create a GUI for all possible resolutions? Is there any
> > function which returns the currently selected screen resolution and font
> > size in Matlab?
> >
> > *bl
> >
> >


had problems if i had a uipanel in gui. other than that all is good.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.