Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
GUI identify caller

Subject: GUI identify caller

From: Aron Sceidt

Date: 3 Jun, 2011 09:22:02

Message: 1 of 4

I need to make a general function which will be called by many objects of my UI. However from inside this general function, I need to identify the caller of the function (which object). One solution that comes to mind is giving an id for each caller and passing it as a parameter when calling the function, but I think it's a little bit messy.

Subject: GUI identify caller

From: Aron Sceidt

Date: 3 Jun, 2011 09:36:02

Message: 2 of 4

"Aron Sceidt" <sigarru87@gmail.com> wrote in message <isa93q$b42$1@newscl01ah.mathworks.com>...
> I need to make a general function which will be called by many objects of my UI. However from inside this general function, I need to identify the caller of the function (which object). One solution that comes to mind is giving an id for each caller and passing it as a parameter when calling the function, but I think it's a little bit messy.

Perhaps my real question here is.. from the handles and hObject how would you know which object must be changed (and actually change it). For example the value

Subject: GUI identify caller

From: Nasser M. Abbasi

Date: 3 Jun, 2011 09:48:36

Message: 3 of 4

On 6/3/2011 2:36 AM, Aron Sceidt wrote:
> "Aron Sceidt"<sigarru87@gmail.com> wrote in message<isa93q$b42$1@newscl01ah.mathworks.com>...
>> I need to make a general function which will be called by many objects of my UI.
>However from inside this general function, I need to identify the caller of the function
>(which object). One solution that comes to mind is giving an id for each caller and
>passing it as a parameter when calling the function, but I think it's a little bit messy.
>
> Perhaps my real question here is.. from the handles and hObject how would you know
>which object must be changed (and actually change it). For example the value

if you use GUIDE, then hOject is the handle of the UI object
which made the callback.

--Nasser

Subject: GUI identify caller

From: ImageAnalyst

Date: 3 Jun, 2011 11:14:24

Message: 4 of 4

On Jun 3, 5:22 am, "Aron Sceidt" <sigarr...@gmail.com> wrote:
> I need to make a general function which will be called by many objects of my UI. However from inside this general function, I need to identify the caller of the function (which object). One solution that comes to mind is giving an id for each caller and passing it as a parameter when calling the function, but I think it's a little bit messy.

----------------------------------------------------------
Could it be the "dbstack" function that you're looking for?

Tags for this Thread

No tags are associated with this thread.

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.

Contact us