<!-- Converted by db4-upgrade version 1.0 -->

<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="attach">

  <refmeta>
    <refentrytitle>ATTACH</refentrytitle>
    <manvolnum>nged</manvolnum>
    <refmiscinfo class="source">BRL-CAD</refmiscinfo>
    <refmiscinfo class="manual">BRL-CAD User Commands</refmiscinfo>
  </refmeta>
  
  <refnamediv xml:id="name">
    <refname>attach</refname>
    <refpurpose>
      Opens a display window.
    </refpurpose>
  </refnamediv>
  
  <!-- body begins here -->
  <refsynopsisdiv xml:id="synopsis">
    <cmdsynopsis sepchar=" ">
      <command>attach</command>    
      <arg choice="opt" rep="norepeat">-d <replaceable>display_string</replaceable></arg>
      <arg choice="opt" rep="norepeat">-i <replaceable>init_script</replaceable></arg>
      <arg choice="opt" rep="norepeat">-n <replaceable>name</replaceable></arg>
      <arg choice="opt" rep="norepeat">-t <replaceable>is_toplevel</replaceable></arg>
      <arg choice="opt" rep="norepeat">-W <replaceable>width</replaceable></arg>
      <arg choice="opt" rep="norepeat">-N <replaceable>height</replaceable></arg>
      <arg choice="opt" rep="norepeat">-S <replaceable>square_size</replaceable></arg>
      <arg choice="opt" rep="norepeat"><replaceable>win_type</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  
  <refsection xml:id="description"><info><title>DESCRIPTION</title></info>
    
    <para>
      This command is used to open a display window. The set of supported
      window types includes X and ogl. It should be noted that 
      <command>attach</command> no longer releases previously attached display 
      windows (i.e., multiple attaches are supported). To
      destroy a display window, use the <command>release</command> command.
    </para>
  </refsection>
  
  <refsection xml:id="examples"><info><title>EXAMPLES</title></info>
    
    <para>
      These examples demonstrate the use of the <command>attach</command> command 
      to open ogl and X display windows.
    </para>
    <example><info><title>Opening an ogl display window</title></info>
      
      <variablelist>
	<varlistentry>
	  <term><prompt>mged&gt;</prompt> <userinput>attach ogl</userinput></term>
	  <listitem>
	    <para>
	      Opens an ogl display window named .dm_ogl0 (assuming this is the first 
	      ogl display window opened using the default naming scheme)
	    </para>
	   </listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged</prompt> <userinput>attach ogl</userinput></term>
	<listitem>
	  <para>
	    Opens an ogl display window named .dm_ogl1.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>attach -n myOgl -W 720 -N 486 ogl</userinput></term>
	<listitem>
	  <para>
	    Opens a 720 x 486 OpenGL display window named myOgl. 
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>attach -n myX -d remote_host:0 -i myInitX</userinput></term>
	<listitem>
	  <para>
	    Open an X display window named myX on remote_host that is initialized by
	    myInit.
	  </para>
	  <para>
	    myInit might contain user-specified bindings like those found in the default
	    bindings.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>toplevel.t</userinput></term>
	<listitem>
	  <para>
	    A top-level window named .t was created.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>attach -t 0 -S 800 -n .t.ogl ogl</userinput></term>
	<listitem>
	  <para>
	    Opens a 800 x 800 OpenGL display window named .t.ogl that is not a top-level window.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>button .t.dismiss -text Dismiss -command "release .t.ogl; destroy .t"</userinput></term>
	<listitem>
	  <para>
	    Creates a button that dismisses the display manager, etc.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>pack .t.ogl -expand 1 -fill both</userinput></term>
	<listitem>
	  <para>
	    Packs the display manager inside .t.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>pack .t.dismiss</userinput></term>
	<listitem>
	  <para>
	    Packs the Dismiss button inside .t.
	  </para>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><prompt>mged&gt;</prompt><userinput>attach</userinput></term>
	<listitem>
	  <para>
	    Lists the help message that includes the valid display types.
	  </para>
	</listitem>
      </varlistentry>
      </variablelist>
    </example>
  </refsection>
  
  <info><corpauthor>BRL-CAD Team</corpauthor></info>
  
  <refsection xml:id="bug_reports"><info><title>BUG REPORTS</title></info>
    
    <para>
      Reports of bugs or problems should be submitted via electronic
      mail to &lt;devs@brlcad.org&gt;, or via the "cadbug.sh" script.
    </para>
  </refsection>
</refentry>
