Generating a new pushbutton on button press

2 visualizaciones (últimos 30 días)
Samuel Crofts
Samuel Crofts el 28 de Dic. de 2018
Editada: Jan el 28 de Dic. de 2018
Hi,
I am attempting to create a basic multiple choice RPG using guide. To get round using multiple GUIs, i thought a good way of doing this would be on buttonpress. creating an almost identical button in the same place as the old one, how would one go about attempting this?

Respuesta aceptada

Jan
Jan el 28 de Dic. de 2018
Editada: Jan el 28 de Dic. de 2018
While I do not know, what a "mutliple choice RPG" is, and " doing this would be on buttonpress" is not clear also, modifying a button is easy:
figure;
handles.ButtonH = uicontrol('Style', 'PushButton', 'String', 'Text 1');
pause(1);
handles.ButtonH.String = 'Text 2';
pause(2)
handles.ButtonH.String = 'Text 3';
... etc.
So simply modify the property you want to change. If you have a different number of buttons, you can hide a button by setting its property 'Visible' to 'off' also.

Más respuestas (0)

Categorías

Más información sobre App Building en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by