Generating a new pushbutton on button press

2 Ansichten (letzte 30 Tage)
Samuel Crofts
Samuel Crofts am 28 Dez. 2018
Bearbeitet: Jan am 28 Dez. 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?

Akzeptierte Antwort

Jan
Jan am 28 Dez. 2018
Bearbeitet: Jan am 28 Dez. 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.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by