MATLAB Answers

How to test GUIs on different systems?

6 views (last 30 days)
William Thielicke
William Thielicke on 7 Nov 2018
Commented: Walter Roberson on 7 Nov 2018
Hi, I think this is my first question here, and I'll start right away with a silly one. The first impression is most important, right...?
I would love to get some general advice or guidance, that's why my story is a bit longer, sorry: I made a Matlab toolbox (or whatever you want to call it) that became relatively popular. The main part is a pretty complicated GUI that I made years ago with an old Matlab version and GUIDE. From time to time I update the GUI with new features, and this time it seems that GUIDE destroyed my GUI: I tried to change all units to "characters", because Mac users reported layout issues. Now with my latest release everyone might have layout problems + GUIDE is crashing and hanging often. So my favorite solution atm is to recreate the whole GUI without GUIDE. This will take many nights of programming, and I wonder if it will solve my problem. I am looking for a possibility to test my GUI during development on different systems. Or maybe there is a way to simulate different dpi and resolutions and system UIelements? Are there maybe automated services for this, or is there an active user group? Anything that could help? Or any advice on how to make sure that the end result will be better without GUIDE? Thank you! This is the GUI at the moment (with layout issues, made with GUIDE): https://de.mathworks.com/matlabcentral/fileexchange/27659-pivlab-particle-image-velocimetry-piv-tool

  4 Comments

Show 1 older comment
Walter Roberson
Walter Roberson on 7 Nov 2018
To deal with display resolution differences between Linux and windows and different people having different resolutions even between those, what I came up with at work was more or less a series of layout routines. A lot of the positioning work involved putting in the real text I needed or temporary text of maximum length, and asking MATLAB how much space it needed to render it, autosizing components, and placing components lined up relative to other components instead of at absolute positions or using proportional space. Proportional sizing cannot simultaneously take care of text and graphics, as those have opposing layout goals.
It did not turn out to be a large set of operations, but to be honest it was all a bit tedious.
I did at one point use a product for creating guis in c or c++ where the product was designed to produce portable guis for multiple operating systems and resolutions. The product offered a number of features for positioning elements and anchoring parts to each other and marking which spacing was to be stretchable with max and min spaces, and other similar features to permit design. Unfortunately the tool was fairly expensive at the time and also the company went under or stopped offering it. So fairly adjustable layouts are possible, but I could not name any current comprehensive products for the purpose. I don't know, perhaps css has taken over that role.
William Thielicke
William Thielicke on 7 Nov 2018
Thanks for your input Walter! I will check out the possibility of rendering text and reporting the required space. But testing if this works will still require a test on other systems... I will also add a menu element in the GUI that enables the user to scale the text in the GUI. Maybe that helps...
Walter Roberson
Walter Roberson on 7 Nov 2018
The setup I created did permit users to choose font size and automatically re-layed out the screen when they did. What I did for that was to attach to each text entity information about the relative font size, so -2 for two sizes smaller than the base up to +2 for two sizes larger than the base (for headers). The routine that did the layout would then findobj for all of the items with the appropriate property, and adjust their font size property relative to the new base font and then recalculate the container size, reposition anything relative, and so on. The layout call also had to be hooked into the figure resize callback so that everything would readjust as the user resized the figure.
Have you ever happened to use a comprehensive document authoring program intended for publishing purposes? One that had to deal with multiple columns per page, and figures, and equations, and intelligently flowing text around boxes? The conceptual operations for a good looking gui are pretty similar.

Sign in to comment.

Answers (0)

Sign in to answer this question.