str = sprintf('Overplot\nSelected\Variables');
set(hObject,'String',str);
This resulted in only "Overplot" appearing on the push button.
Cheers,
SteveB.
I don't know that it's possible with just the MATLAB uicontrol. But you can do it with Java. Download findjobj from the FEX, and look at the function createJButton. (This is the function used to create the buttons along the bottom of the GUI, which are multi-line buttons. These buttons are created around line 1300.)
see also createButtonLabel of Brett Shoelson:
http://www.mathworks.com/matlabcentral/fileexchange/15018
and uibutton of Doug Schwarz:
http://www.mathworks.com/matlabcentral/fileexchange/10743
Modern Matlab versions can interprete HTML in buttons also, but this is not documented:
uicontrol('style', 'pushbutton', 'position', [10, 10, 200, 200], ...
'String', '<html>Line 1<br>Line2');
Good luck, Jan
Cheers,
SteveB.
"Jan Simon" <matlab.T...@nMINUSsimon.de> wrote in message <i29p5r$5k5$1...@fred.mathworks.com>...
> Thanks to both of you!
And thanks to Yair in addition for the <html> trick.
Jan
See more information about the HTML support here:
http://UndocumentedMatlab.com/blog/html-support-in-matlab-uicomponents/
Yair Altman
http://UndocumentedMatlab.com