From: Stephen on 22 Jul 2010 09:03 How do I get a multiple line push button string? In the create function I tried, str = sprintf('Overplot\nSelected\Variables'); set(hObject,'String',str); This resulted in only "Overplot" appearing on the push button. Cheers, SteveB.
From: Andy on 22 Jul 2010 09:23 "Stephen " <stephen.bachner(a)navy.mil> wrote in message <i29fi8$dc3$1(a)fred.mathworks.com>... > How do I get a multiple line push button string? In the create function I tried, > > 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.)
From: Jan Simon on 22 Jul 2010 11:47 Dear Stephen, 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
From: Stephen on 22 Jul 2010 12:38 Thanks to both of you! Cheers, SteveB. "Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i29p5r$5k5$1(a)fred.mathworks.com>... > Dear Stephen, > > 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
From: Jan Simon on 22 Jul 2010 13:02 Dear Stephen, > Thanks to both of you! And thanks to Yair in addition for the <html> trick. Jan
|
Next
|
Last
Pages: 1 2 Prev: Don`t get a value while using randomnumbers Next: Saveas or print with eps format |