How do i figure out what my handle is?

1 visualizzazione (ultimi 30 giorni)
Kenneth Harp
Kenneth Harp il 8 Apr 2017
Commentato: per isakson il 9 Apr 2017
Hi, I'm producing a hangman game as a final project for a class. I am making a GUI to run the game in. Currently, I am trying to create a pushbutton that will be invisible for most of the game, but when you either win or loose, the button will be visible. I know how to make it, yet I am having trouble with setting the visibility. the code for the button is:
but_new = uicontrol('style','pushbutton','string','NEW GAME?',...
'fontname','comic sans ms','fontsize',16 ...
,'units', 'normalized','position', [.01 .21 0.15 0.05],...
'visible','off','callback', @new_but)
I know this makes an invisible button in the bottom left corner of the figure that says "NEW GAME?" I have tried using the code:
set(but_new,'visible','on')
to make the button visible but I receive the error: "Undefined function or variable 'but_new'." I believe my problem is I am not putting in the proper handle. I do not know how to find the proper handle. Also, I am trying to not use GUIDE
Thanks!!

Risposte (0)

Categorie

Scopri di più su Migrate GUIDE Apps 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