Generating a new pushbutton on button press

2 visualizzazioni (ultimi 30 giorni)
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?

Risposta accettata

Jan
Jan il 28 Dic 2018
Modificato: Jan il 28 Dic 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.

Più risposte (0)

Categorie

Scopri di più su App Building in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by