Monday 15 February 2010

user interface - Dynamic Population of Popup Menu - MATLAB -


Another guide question.

I have created a GUIDE figure with a pop up menu. While calling data, the elements of the menu are dynamically determined. Example: myGUI (data, popup name) should be called and then the strings included in popup names should be used to label options. I am able to do this in the callback for the popup menu. Although this means popups will not be populated until I actually press on the popup menu and select the first blank (empty) option.

My question is how can I populate it dynamically Create a function (or some other function) I also need to do this with a proper function (fill the row and column names, Although this is not dynamic anymore)

My unsuccessful attempt, which led me to realize that I could not use handle, the data in the construction work was as follows:

 < Code>% --- object builder When executed, after setting all properties. Function Popup menu 1_CreateFcn (H object, Event data, Handle) are popup names = varargin {2}; Set (hObject, 'string', {handles.popupNames {1: end}}); % --- executed during the creation of the object, after installing all the properties. Function uitable1_CreateFcn (H object, Event Data, Handle) handset. Data = varargin {1}; T = utility (handles. Appropriate 1); Set (t, 'data', handlesdata {1}) set (t, 'columnname', {'a', 'b', 'c'}) set (t, 'ro name', {'1' '2 ',' 3 '})    

The guide creates a myGui_OpeningFcn (HObject , EventData, Handle, WarGin) . In it, you can initialize your string:

  The function handles myGui_OpeningFcn (hObject, eventdata, handle, verruin). Output = hObject; Set (handles pop menu 1, 'string', virgin {2}); Set (handles. Appropriate1, 'data', wordpress {1}); Set (handles. Appropriate 1, 'column name', {'a' 'b' 'c'}); Set (handles. Appropriate1, 'ro name', {'1' '2' '3'}); Guadata (Hobbect, Handle); End   

Use the new handle for the GUI with the handle structure updates. If you do not call guidata , then whenever you change the handles structure, the changes you have made will not be reflected.

No comments:

Post a Comment