Generating a new pushbutton on button press

2 vues (au cours des 30 derniers jours)
Samuel Crofts
Samuel Crofts le 28 Déc 2018
Modifié(e) : Jan le 28 Déc 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?

Réponse acceptée

Jan
Jan le 28 Déc 2018
Modifié(e) : Jan le 28 Déc 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.

Plus de réponses (0)

Catégories

En savoir plus sur App Building dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by