# Advanced MATLAB: Handles and other inputs to GUIDE callbacks17

Posted by Doug Hull,

There are three inputs to every automatically generated callback from GUIDE:

function edit1_Callback(hObject, eventdata, handles)

A common question that I am asked is “What is the handles structure?” This four minute video will show a simple GUI where you edit some text, and press a button that will copy that text into a third uicontrol. This is all done using the handles structure. The other two inputs: hObject and eventdata will be briefly discussed also.

Video Content

Quan replied on : 1 of 17

Nice video as usual. You need a nickname of some sorts . . . I was thinking “The MATLAB Evangelist” might a good one.

But seriously, good videos. I want to start linking them from blinkdagger because I think the tutorials supplement each other very well.

naor replied on : 2 of 17

Doug,
Can you explain about guidata(hObject,handles)? I thought this was necessary after any change to handles.
Thanks

jiro replied on : 5 of 17

Quan,

There’s actually 6 of us at The MathWorks with an internal title of “LTC Evangelist” (LTC = Language of Technical Computing = MATLAB). I am one of them, and Doug used to be in this group as well.

amiryousuf replied on : 6 of 17

Hello, Can we output data entered by user in dialogbox to command window?

Administrator replied on : 7 of 17

Amir,

You would simply modify the callback to use the DISP command to display any data you want.

Doug

amiryousuf replied on : 8 of 17

thanks for the idea. it is working.

Tayfun replied on : 9 of 17

ıt is very good video. I learn a lot of new things about gui

Zach replied on : 10 of 17

Doug,
I have a GUI that I put a timer in so that it will check if any serial data has come in every second. I am having trouble getting the Timer to pass the handles structure to my function that is plopped into the M-file that guide made. On compile it says that the “handles” is undefined. I tried to pass the hadles from the Timer funtion by saying {@myfunction, handles} to pass the handles to the myfunction but I get another compile problem. any help would be great.

Zach replied on : 12 of 17

Doug,
I cant get the file to play from link or by going to list??

Doug replied on : 13 of 17

I have tested, it is working now.

Doug

nico replied on : 14 of 17

thank you!! i’ve been looking for something like this

Ferdy replied on : 15 of 17

Thanks a lot!! Been at it for some time now

Nabil replied on : 16 of 17

I would like to know how to pass data between different guis.
Thank you in advance

Hugo replied on : 17 of 17

Hey my friend. How can I add a “Edit text” and make it visible only when the user press a “Push Button”? Tnx and God bless you !!

These postings are the author's and don't necessarily represent the opinions of MathWorks.