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 force execution of callback functions

Subject: GUI force execution of callback functions

From: Christian Sueltrop

Date: 2 Dec, 2010 09:26:04

Message: 1 of 3

Hello,

I have a GUI made with GUIDE.
One of my callback functions executes a computationally extensive task.
I want this function to interact with other callback functions. Therefore, I store some variables in the 'handles' object. These are altered by clicking buttons in the GUI.
Sometimes the buttons' callback function are executed, sometimes they are not. I believe this is due to the extensive work done by the 'main' callback function.

Is there a way to force execution of callback functions?

Regards,
Christian

Subject: GUI force execution of callback functions

From: Paulo Silva

Date: 9 Dec, 2010 14:07:05

Message: 2 of 3

"Christian Sueltrop" <siphcopp@gmx.net> wrote in message <id7onc$2t9$1@fred.mathworks.com>...
> Hello,
>
> I have a GUI made with GUIDE.
> One of my callback functions executes a computationally extensive task.
> I want this function to interact with other callback functions. Therefore, I store some variables in the 'handles' object. These are altered by clicking buttons in the GUI.
> Sometimes the buttons' callback function are executed, sometimes they are not. I believe this is due to the extensive work done by the 'main' callback function.
>
> Is there a way to force execution of callback functions?
>
> Regards,
> Christian

try using setappdata and getappdata instead of the handles to share data

Subject: GUI force execution of callback functions

From: Bruno Luong

Date: 9 Dec, 2010 14:49:05

Message: 3 of 3

"Christian Sueltrop" <siphcopp@gmx.net> wrote in message <id7onc$2t9$1@fred.mathworks.com>...
> Hello,
>
> I have a GUI made with GUIDE.
> One of my callback functions executes a computationally extensive task.
> I want this function to interact with other callback functions. Therefore, I store some variables in the 'handles' object. These are altered by clicking buttons in the GUI.
> Sometimes the buttons' callback function are executed, sometimes they are not. I believe this is due to the extensive work done by the 'main' callback function.
>
> Is there a way to force execution of callback functions?

Call the GUI ifself wile passing the callback name (in string) as first input (read the help of your own GUI name).

Bruno

Tags for 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