MATLAB Answers

How to pass value to edit box in GUI without interacting with it

1 view (last 30 days)
Vassilis
Vassilis on 26 Sep 2013
Answered: Image Analyst on 26 Sep 2013
My problem is the following: I have a Mtlab program with GUI. When a specific button is pressed from the main(initial) window, a new window opens and the user interacts with things inside this window. As a result, a numerical value is being produced that is stored somewhere (globally).
After I close this window, I want this value to be written as the 'String' attribute in an edit box that exists on the first window. The only way I managed to do this until now, is to create a Callback function for when the textbox is "pressed" (i.e the user presses enter when in the box). This means that the user interacts with the second window, produces the value, presses OK, but in order for his value to be seen in the first window he needs to call the callback function of the textbox by pressing enter in it.
It would be much easier if the data could be written in the textbox immediately after the window closes without any other input from the user.
The window is being closed with the delete command when the user presses the OK button in it.
Sorry for the naive question, but I am only using the Matlab GUI functions for less than a week.

  0 Comments

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 26 Sep 2013
Perhaps use linkprop()? I haven't experimented with that so I can't help you.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!