"Jordan Rosenthal" <firstname.lastname@example.org> wrote in message <email@example.com>... > 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" <firstname.lastname@example.org> wrote in message > news:FM2DBn.email@example.com... > > 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.