How to get the object handle of gui which is not running and change some property??

Hi guys!!
I have two GUIs namely GUI 'A' and 'B'. On clicking a pushbotton on GUI A, string of editable text on GUI 'B' should be changed. I tried too many methods , but not got the desired results.
Thanks in advance..

9 Comments

You need to get the handle from one GUI to the other. There are many ways to accomplish this, one of them is to have a specific tag that you can use with findobj.
I have used findobj command, but results in that error..
0x0 empty GraphicsPlaceholder array.
I have used that command..
u1=findobj('tag','MaterialName','Style','edit')
Ahmed - try finding the handle to the GUI and then use that to get the handle of the edit text control.
Does not make a difference. The error remains same brother..
Ahmed - what line of code are you using to do that? Are your GUIs created with GUIDE, App Designer, or programmatically?
Too complex maybe if you haven't done any OOP before, but my solution to GUIs interactibg with each other is to use a handle-derived class to act as the communication link between them. Something similar to what I laid out in this question
Not the same situation as yours, but the same idea of GUIs communicating with each other.
The idea is to have a handle-derived object that is passed to both GUIs, with a set of properties and listeners. One GUI can set a property on the object, the other GUI listens for changes to that property or for an event being triggered and reacts in whatever way it sees fit. And vice versa too if two-way communication is desired.
I imagine you just want a simple solution for this case (for me the linked approach is simple because I am used to it, but not for someone unfamiliar), but from a software engineering perspective I never like having GUIs fishing around in the handles of other GUIs and editing things, or indeed anything external to the GUI having the ability to set things!
Adam, it seems interesting, am developing an app using matlab guide and continuously facing such problems. Kindly provide me some example about such usage.
and Thanks for the info.
@Ahmed, you could also have a look here for alternatives to GUIDE.

Sign in to comment.

Answers (1)

See the latter portion of this FAQ entry, namely the part that says "Sharing between multiple GUIs."

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Asked:

on 31 Jan 2020

Answered:

on 31 Jan 2020

Community Treasure Hunt

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

Start Hunting!