How would I create a GUI with a push button that when clicked, text will appear?
14 次查看(过去 30 天)
显示 更早的评论
In the callback, would I need to add a text file like;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
open('C:\matlabcodes folder\readme.txt')
Additionally, is there a way to put an active link to a website in this text?
2 个评论
Geoff Hayes
2017-11-15
Caitlin - where will the text appear? In a control on your GUI or are you opening a file? Please clarify.
回答(1 个)
Image Analyst
2017-11-15
- Use GUIDE.
- Place a button.
- Place a static text.
- Double click on the text label and set the visible property to off in the Property Inspector.
- Save the GUI and then go to the editor and go to the push button callback function.
- Put this line of code:
handles.button1.Visible = 'on'; % Make text appear.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!