<doc>
	<legacy_id>1896</legacy_id>
	<name>text</name>
	<type>property</type>

	<syntax>
		<example>set the text of {<i>button</i> |<i> field</i> | <i>image</i>} to <i>string</i></example>
	</syntax>

	<synonyms>
		<synonym>textData</synonym>
	</synonyms>

	<summary>Specifies the text contained by a <keyword tag="button">button</keyword> or <keyword tag="field">field</keyword> or the <glossary tag="binary data">binary data</glossary> in an <keyword tag="image">image</keyword>.</summary>

	<examples>
<example>put the text of button "Popup" into menuContents</example>
<example>set the text of field "Display Script" to the script of the target</example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="5.5">Always native encoding</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
		<field/>
		<button/>
		<image/>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<server/>
		<web/>
		<mobile/>
	</classes>

	<security>
	</security>


	<classification>
		<category>Appearance &amp; Positioning</category>
		<category>Menus</category>
		<category>Text and Data Processing</category>
	</classification>

	<references>
		<function tag="target">target Function</function>
		<property tag="unicodeText">unicodeText Property</property>
	</references>

	<description>
	<overview>Use the <b>text</b> <glossary tag="property">property</glossary> to work with the contents of a <keyword tag="field">field</keyword>, <keyword tag="button">button</keyword>, or <keyword tag="image">image</keyword>.</overview>

		<parameters>
		</parameters>

	<value>The <b>text</b> of a <keyword tag="field">field</keyword>, <keyword tag="button">button</keyword>, or <keyword tag="image">image</keyword> is a <keyword tag="string">string</keyword>.</value>
	<comments><b>Fields</b><p>The text of a field is simply the contents of the field. You can also use the <b>target</b> <glossary tag="keyword">keyword</glossary> to obtain the contents of a <keyword tag="field">field</keyword>:</p><p></p><p>  the text of the target is target</p><p><i>-- evaluates to true if target is a field</i></p><p></p><p>The <b>text</b> of a field is always returned in the native encoding.</p><p></p><p><b>Buttons</b></p><p>The <b>text</b> of a <keyword tag="button">button</keyword> is used as the <glossary tag="button">button's</glossary> <keyword tag="menu">menu</keyword> contents. (A menu whose contents is the <b>text</b> of a <keyword tag="button">button</keyword> is called a <glossary tag="button menu">button menu</glossary>. ) If the <glossary tag="button">button's</glossary> <property tag="style">style</property> is not set to "menu", the setting of its <b>text</b> <glossary tag="property">property</glossary> has no effect. However, the <b>text</b> <glossary tag="property">property</glossary> can be used to store data in a <keyword tag="button">button</keyword>, regardless of the <glossary tag="button">button's</glossary> <property tag="style">style</property>; the text is not visible to the user unless the <keyword tag="button">button</keyword> is a <glossary tag="button menu">button menu</glossary>.</p><p></p><p>See the <keyword tag="menu">menu keyword</keyword> entry for more information about the format of menu item entries in the menu button text.</p><p></p><p>The <b>text</b> of a button is always returned in the native encoding.</p><p></p><p><b>Images</b></p><p>The <b>text</b> of an image is the binary data that makes up the image. The following formats are supported:</p><p></p><p><b>Fully Supported Formats</b></p><p>Setting the text to one of these formats displays the image as expected and sets the paintCompression to the correct type automatically. The data is also preserved meaning that getting the <b>text</b> returns the original data unchanged.</p><p>- GIF (All platforms)</p><p>- JPEG (All platforms)</p><p>- PNG (All platforms)</p><p>- WMF (Windows only - Windows Metafile)</p><p>- EMF (Windows only - Windows Enhanced Metafile)</p><p></p><p><b>Import Only Formats</b></p><p>There are also some formats that are not fully supported but can be imported. The image is converted to one of the supported formats, depending on the global <property tag="paintCompression">paintCompression property</property>.</p><p>- BMP (Windows bitmap)</p><p>- XWD (X Windows Dump format)</p><p>- XBM (X Windows Bitmap)</p><p>- XPM (X Windows Pixmap)</p><p>- PBM (NetPBM Portable Bitmap)</p><p>- PGM (NetPBM Portable Greyscale Map)</p><p>- PPM (NetPBM Portable Pixmap)</p><p></p><p></p><note> Indeed, it is odd to be calling <glossary tag="binary data">binary data</glossary> the "text" <glossary tag="property">property</glossary>. The usage came about for historical reasons.</note><p></p><p>These two statements are equivalent:</p><p></p><p>  set the text of <i>object</i> to <i>string</i></p><p>  put <i>string</i> into <i>object</i></p><p></p><p></p><tip> Instead of displaying a <glossary tag="button">button's</glossary> text when using the <keyword tag="button">button</keyword> as a menu, you can designate a <object tag="stack">stack</object> to be displayed as the menu contents. This type of menu is called a <glossary tag="stack menu">stack menu</glossary>. If the <glossary tag="button">button's </glossary><property tag="menuName">menuName</property><glossary tag="property">property</glossary> is not empty, the <object tag="stack">stack</object> specified by the <property tag="menuName">menuName</property> is used as the menu contents, instead of the <glossary tag="button">button's </glossary><b>text </b><glossary tag="property">property</glossary>.</tip></comments>
	</description>
</doc>