function [] = script2()fig = figure('units','pixels','position',[300 300 500 400], 'menubar','none','name','GUI_3','numbertitle','off','resize','off');listh = uicontrol('style', 'list', 'unit', 'normalized', 'position', [0.25, 0.4, 0.5, 0.5], 'string', {'one';'two';'three';'four'}, 'FontSize', 14); pushbuttonh = uicontrol('style', 'pushbutton', 'unit', 'normalized', 'position', [0.375, 0.125, 0.2, 0.1], 'FontWeight', 'bold', 'string', 'Submit', 'FontSize', 14, 'Callback', @pushbuttonh_Callback);texth = uicontrol('style', 'edit', 'unit', 'normalized', 'position', [0.35, 0.25, 0.275, 0.075], 'String', 'Enter New String', 'FontSize', 12.5);function pushbuttonh_Callback(source, value)oldstring = get(listh, 'String');addstring = {get(texth, 'String')};oldstring{5} = addstring;set(listh, 'String', oldstring);endend
MATLAB: How to use set to change a property of a uicontrol
matlab gui
Related Question
- How do you get the keypressfcn to register the user pushing enter, and only play the following code once they push enter
- Resize subplot
- I need to generate a GUI that displays a random number between 0-10000 everytime “Button” is pressed
- Placing radiobuttons with relative locations
- How to pass values selected from a GUI interface to another *.m script
Best Answer