What is edit text box type in GUI when I using findobj function?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Teemu Juujärvi
il 27 Ago 2015
Commentato: Teemu Juujärvi
il 1 Set 2015
Hi,
I try to get GUI edit text box object in separate m-file because I like to print something to this text box from m-file. What is the 'Type' of this edit text box when using findobj function?
Teemu
0 Commenti
Risposta accettata
Cam Salzberger
il 31 Ago 2015
Hello Teemu,
The 'Type' of an edit box is actually 'uicontrol', just like all other UI Controls (push buttons, pop-up menus, etc). However, you can specify the 'Style' property when calling findobj to get only edit boxes:
figure
uicontrol('Style','pushbutton')
uicontrol('Style','edit')
hEditBoxes = findobj('Type','uicontrol','Style','edit');
Note that if you use findobj a lot in your code, it can slow things down. If at all possible, save the handle from when you create the edit box (or extract it from the handles structure if the GUI is made in GUIDE) and pass it as an input argument to the function that needs access to the edit box.
I hope that this has helped!
-Cam
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Specifying Target for Graphics Output in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!