Thread Subject: GUI button's callback

Subject: GUI button's callback

From: Yuri Geshelin

Date: 26 Jun, 2008 13:27:01

Message: 1 of 3

Can someone explain me this please?

Suppose I set up a callback to a GUI button like this:

set(button_handle,'callback',@my_function)

I noticed that in this case my_function must have at least
2 input arguments, of which the first is button_handle.

My question is, what is the 2nd argument? What do we need
it for?

Thanks,

Yuri

Subject: GUI button's callback

From: Steven Lord

Date: 26 Jun, 2008 13:47:19

Message: 2 of 3


"Yuri Geshelin" <geshelin@hotmail.com> wrote in message
news:g405f5$95h$1@fred.mathworks.com...
> Can someone explain me this please?
>
> Suppose I set up a callback to a GUI button like this:
>
> set(button_handle,'callback',@my_function)
>
> I noticed that in this case my_function must have at least
> 2 input arguments, of which the first is button_handle.
>
> My question is, what is the 2nd argument? What do we need
> it for?

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f7-55506.html#brdjimp-1

--
Steve Lord
slord@mathworks.com


Subject: GUI button's callback

From: WASHINGTON

Date: 30 Jun, 2008 21:55:34

Message: 3 of 3

Let's see, when you progrm GUI from M.file , you can create button, slider, satic text, etc. using:
hImportar = uicontrol('Style','pushbutton',...
            'String','Importar',...
            'Position',[5 120 100 35],...
            'Parent',rightPanel,...
            'Callback',{@Importar_Callback});

Style,String,Position,Callback are property of uicontrol,
and @Importar_Callback ,call the function:

function Importar_Callback(source,eventdata)
   %put here any action of callabck
   %for exmple, clos the gui
   Close
end

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
gui button callback Yuri Geshelin 26 Jun, 2008 09:30:20
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com