There is no Text property on the Menu class
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Aleksey Maksimov
il 14 Gen 2018
Commentato: Aleksey Maksimov
il 14 Gen 2018
I try to create simple menu in the Matlab R2017a
h_f = figure('MenuBar','none','ToolBar','none');
h_menu = uimenu(h_f,'Text','Run');
but receive an error 'There is no Text property on the Menu class'.
For some reasons if I change it to
h_f = figure('MenuBar','none','ToolBar','none');
h_menu = uimenu(h_f,'Label','Run');
it works properly, while Matlab Help states that 'Use of the Label property is not recommended. It might be removed in a future release. Use the Text property instead'.
So where is the problem? 'Text' property was introduced only in the R2017b version?
Also I want to create submenus and this code doesn't work
h_menu_item = uimenu(h_menu,'Label','Ready','Label','Steady','Label','Go');
But this works:
h_menu_item = uimenu(h_menu,'Label','Ready');
h_menu_item = uimenu(h_menu,'Label','Steady');
h_menu_item = uimenu(h_menu,'Label','Go');
Why I couldn't concatenate it in one line?
0 Commenti
Risposta accettata
Walter Roberson
il 14 Gen 2018
Yes, Text does appear to have been introduced in R2017b, and I do not see the change described in the release notes.
You cannot put those three items in one line because you are creating three different graphics objects, not a single graphics object with a list of character vectors.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Labels and Annotations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!