Update slider value after enter a value in editbox.
Mostrar comentarios más antiguos
I have a slider that I can use to increment an editbox. However I also need to be able to enter a value in the editbox. If I enter a value in editbox and them I cick on the slider it not work properly (if before I don’t press enter). I try to update the value of the slider on the editbox callback by doing something like:
set(hslider, 'value', val);
But this don’t work properly which I believe is related with the need to add an enter after add the value to a editbox.
1 comentario
Ilham Hardy
el 22 de En. de 2016
Why you don't want to use enter button?
Respuestas (1)
Walter Roberson
el 22 de En. de 2016
Editada: Walter Roberson
el 22 de En. de 2016
0 votos
Correct. The Callback of the Edit box is not invoked until an enter is received.
6 comentarios
Armindo
el 22 de En. de 2016
Walter Roberson
el 22 de En. de 2016
How would you know that it was needed?
Take a look at my FEX submission "Regular Expression Helper", it uses the key-press function to update strings used in regexp (and displays the output). This would be easy to adapt to update a slider value.
Armindo
el 22 de En. de 2016
Walter Roberson
el 22 de En. de 2016
The problem with using the KeyPressFcn is that you do not know whether the user is finished typing unless you see the user type a particular character such as return.
Armindo
el 26 de En. de 2016
Categorías
Más información sobre Simulink 3D Animation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!