Gui Pop Up Menu Problem

1 回表示 (過去 30 日間)
Edward
Edward 2012 年 4 月 22 日
Hi, ive got a simple gui with just a pop up menu,
I want to set the value of the string for each element of the pop up menu within the gui program, so the strings can change, say for example if i wanted the menu to have selectable days of the week, but the top element of the menu says 'yesterday' and the following elements are days before that.
How do i refer to each element of the menu within a program?
[Merged duplicate question]
Hi im trying to write a gui with a pop up menu where i can change the string of each element within the program.
how do i refer to each string element of the pop up menu? for example with a regular array you refer to the 5th value as array(5), how do i refer to the 5th string of a pop up menu?
Thanks
  2 件のコメント
Jan
Jan 2012 年 4 月 22 日
Aaargh. I've tried to post an answer in the other thread some seconds ago. After submitting it, the thread has vanished and my answer also. I'm not motivated to type it again.
Please, Edward, do not double-post. It is tedious for the ones, who want to help you.
Walter Roberson
Walter Roberson 2012 年 4 月 29 日
Sorry Jan I must have merged the question out from underneath you.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2012 年 4 月 22 日
popupstrings = cellstr(get(Handle, 'String'));
popupstrings{5} = 'Ago';
set(Handle, 'String', popupstrings);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by