Thread Subject:
ListBoxClicked property/data

Subject: ListBoxClicked property/data

From: Hariom Yadav

Date: 3 Jun, 2012 16:03:06

Message: 1 of 2

Is there any ListBoxClicked property/fileld/data value in a ListBox in Matlab GUI...??

Means, I want to create a menu button having submenus (containing submenus for fuctions. Those functions should be operated on Data listed in Listbox). After selecting a data from ListBox, I have to choose functions from submenus to operate on data. But after doing this an error comes saying that ........

         Reference to non-existent field 'InputListBoxClicked'.

How to rectify this error..??? Or if there is other way round, plz post it.

Thank you,
Hariom
 

Subject: ListBoxClicked property/data

From: Image Analyst

Date: 3 Jun, 2012 17:00:09

Message: 2 of 2

Hariom:
Are you using GUIDE? There is a "menu editor" on the toolbar along the top of GUIDE. It's not on the tool icon panel along with all the rest of them. You can add menus and flyout submenus there. In the callback of the menu item you're wanting to act on the listbox, you can use the handles structure to get to the listbox

listBoxItems = get(handles.listbox1, 'String');
selectedItems = get(handles.listbox1, 'Value');
if length(selectedItems) == 1
  % Only 1 item was selected...
  selectedString = cell2mat(listBoxItems(selectedItems));
  % Then do whatever you want to do with selectedString .....
else
  % Multiple items were selected. How do you want to handle that?
end

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
listboxclicked Hariom Yadav 3 Jun, 2012 12:04:11
data Hariom Yadav 3 Jun, 2012 12:04:11
submenu Hariom Yadav 3 Jun, 2012 12:04:11
rssFeed for this Thread

Contact us