wiki:rp_xml_ele_string
Last modified 4 years ago Last modified on 05/17/10 21:40:28

<string>

A string object represents a single-line or multi-line text value.

  <string id="title">
    <about>
      <label>Title</label>
      <description>This text will be used as the title for all plots.</description>
    </about>
    <default>untitled</default>
  </string>


  <string id="indeck">
    <about>
      <label>Input</label>
      <description>This is the control file for the program.</description>
      <hints>EXAMPLE:  .print ac vm(11) mag(i(vcc))</hints>
    </about>
    <size>40x10</size>
    <default>Enter your SPICE commands
in this area.  Right-click
for a menu of editing options.</default>
  </string>

A string becomes a multi-line string by setting its <size> to WxH. The width W and height H represent a good size for the text editor. They do not limit the overall size of the text.

The <hints> parameter represents a hint for the user, shown below the editing area.

If binary data is loaded into a string element, it changes to show a binary data icon and information about the data type:

If you expect binary data for a particular string element, you can force the binary display mode by setting the string size to binary as follows:

  <string id="tarfile">
    <about>
      <label>Archive File</label>
      <description>Upload a gzipped tar file containing the input data</description>
    </about>
    <size>binary</size>
  </string>

You can see working code in the zoo of examples in the string example directory, or on the hub in the directory /apps/rappture/examples/zoo/string. There's also an example of handling binary data.