GUI callbacks empty?

I inherited a GUI from an ex-colleague. It was made with GUIDE and has 30 or so items, including a lot of boxes to enter numbers. This is my first foray into GUI programming (in any language), and I thought I was getting the hang of it until I realized that many of the callbacks contain no code. Is it possible that there's some other magic code getting executed somewhere that I can't see?

4 comentarios

Ilya Gurin
Ilya Gurin el 6 de En. de 2022
I think I figured out what's happening. It appears that entering data into the GUI object has no immediate effect. However, there's a button that reads the contents of a bunch of these objects and takes action accordingly. It seems slightly backwards to me, but maybe it's OK?
Walter Roberson
Walter Roberson el 6 de En. de 2022
That is a common way of writing GUIs. For example if you have a GUI that needs you to enter latitude and longitude then it does not make much sense to have an action after entering only one of the two.
Ilya Gurin
Ilya Gurin el 6 de En. de 2022
Right. It's a similar situation here. All the numbers feed into one action. But if it were up to me, I would convert the entered text into numbers immediately and store it in a suitable structure. On the other hand, I can't think of a good reason why the way it's written would be wrong.
Walter Roberson
Walter Roberson el 6 de En. de 2022
There is certainly merit to having GUIs do field validation upon entering information -- verifying that a numeric field is convertable to a number for example.
The newer App Designer numeric edit fields are inherently for numeric values, and so reduce the need for validation.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Etiquetas

Preguntada:

el 6 de En. de 2022

Comentada:

el 6 de En. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by