How do i figure out what my handle is?

1 次查看(过去 30 天)
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!!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by