Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!newsfeed.stanford.edu!newsfeed.news.ucla.edu!nrc-news.nrc.ca!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to insert textbox and write text in a figure by code (not manually)
Date: Fri, 17 Aug 2007 14:26:40 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 25
Message-ID: <fa4b70$r7c$1@canopus.cc.umanitoba.ca>
References: <fa1nue$lhh$1@fred.mathworks.com> <fa1qs8$83n$1@fred.mathworks.com> <fa45ci$j9b$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1187360800 27884 192.70.172.160 (17 Aug 2007 14:26:40 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 17 Aug 2007 14:26:40 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:424308


In article <fa45ci$j9b$1@fred.mathworks.com>,
James Anderson <janderson_net@yahoo.com> wrote:
>Another question I forget to ask is that in the command:
>set(mTextBox,'String','Hello World')
>is there any way to set the string to a two-line text so
>that the first line is empty and the second line is "hello
>world"? I tried several times but seems that it only works
>for one line. 

set(mTextbox,'String',{'', 'Hello World'})

You will also find that in some contexts (e.g., -some- uicontrol
styles), you can use '|' to mark the end of lines

set(controlhandle,'String', '|Hello World');

and in some contexts, you can use \n between lines

set(somehandle, 'String', sprintf('\nHello World') );

-- 
  "It is important to remember that when it comes to law, computers
  never make copies, only human beings make copies.  Computers are given
  commands, not permission. Only people can be given permission."
                                               -- Brad Templeton