home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / python / emacs-info / python-lib.info-4 < prev    next >
Encoding:
GNU Info File  |  1994-04-01  |  49.5 KB  |  1,377 lines  |  [TEXT/R*ch]

  1. This is Info file python-lib.info, produced by Makeinfo-1.55 from the
  2. input file lib.texi.
  3.  
  4. This file describes the built-in types, exceptions and functions and the
  5. standard modules that come with the Python system.  It assumes basic
  6. knowledge about the Python language.  For an informal introduction to
  7. the language, see the Python Tutorial.  The Python Reference Manual
  8. gives a more formal definition of the language.  (These manuals are not
  9. yet available in INFO or Texinfo format.)
  10.  
  11. Copyright (C) 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
  12. Amsterdam, The Netherlands.
  13.  
  14. All Rights Reserved
  15.  
  16. Permission to use, copy, modify, and distribute this software and its
  17. documentation for any purpose and without fee is hereby granted,
  18. provided that the above copyright notice appear in all copies and that
  19. both that copyright notice and this permission notice appear in
  20. supporting documentation, and that the names of Stichting Mathematisch
  21. Centrum or CWI not be used in advertising or publicity pertaining to
  22. distribution of the software without specific, written prior permission.
  23.  
  24. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
  25. THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  26. FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR
  27. ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  28. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  29. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  30. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  31.  
  32. 
  33. File: python-lib.info,  Node: Functions Defined in Module stdwin,  Next: Window Object,  Prev: stdwin,  Up: stdwin
  34.  
  35. Functions Defined in Module `stdwin'
  36. ------------------------------------
  37.  
  38. The following functions are defined in the `stdwin' module:
  39.  
  40.  - function of module stdwin: open (TITLE)
  41.      Open a new window whose initial title is given by the string
  42.      argument.  Return a window object; window object methods are
  43.      described below.(1)
  44.  
  45.  - function of module stdwin: getevent ()
  46.      Wait for and return the next event.  An event is returned as a
  47.      triple: the first element is the event type, a small integer; the
  48.      second element is the window object to which the event applies, or
  49.      `None' if it applies to no window in particular; the third element
  50.      is type-dependent.  Names for event types and command codes are
  51.      defined in the standard module `stdwinevent'.
  52.  
  53.  - function of module stdwin: pollevent ()
  54.      Return the next event, if one is immediately available.  If no
  55.      event is available, return `()'.
  56.  
  57.  - function of module stdwin: getactive ()
  58.      Return the window that is currently active, or `None' if no window
  59.      is currently active.  (This can be emulated by monitoring
  60.      WE_ACTIVATE and WE_DEACTIVATE events.)
  61.  
  62.  - function of module stdwin: listfontnames (PATTERN)
  63.      Return the list of font names in the system that match the pattern
  64.      (a string).  The pattern should normally be `'*''; returns all
  65.      available fonts.  If the underlying window system is X11, other
  66.      patterns follow the standard X11 font selection syntax (as used
  67.      e.g.  in resource definitions), i.e. the wildcard character `'*''
  68.      matches any sequence of characters (including none) and `'?''
  69.      matches any single character.
  70.  
  71.  - function of module stdwin: setdefscrollbars (HFLAG, VFLAG)
  72.      Set the flags controlling whether subsequently opened windows will
  73.      have horizontal and/or vertical scroll bars.
  74.  
  75.  - function of module stdwin: setdefwinpos (H, V)
  76.      Set the default window position for windows opened subsequently.
  77.  
  78.  - function of module stdwin: setdefwinsize (WIDTH, HEIGHT)
  79.      Set the default window size for windows opened subsequently.
  80.  
  81.  - function of module stdwin: getdefscrollbars ()
  82.      Return the flags controlling whether subsequently opened windows
  83.      will have horizontal and/or vertical scroll bars.
  84.  
  85.  - function of module stdwin: getdefwinpos ()
  86.      Return the default window position for windows opened subsequently.
  87.  
  88.  - function of module stdwin: getdefwinsize ()
  89.      Return the default window size for windows opened subsequently.
  90.  
  91.  - function of module stdwin: getscrsize ()
  92.      Return the screen size in pixels.
  93.  
  94.  - function of module stdwin: getscrmm ()
  95.      Return the screen size in millimeters.
  96.  
  97.  - function of module stdwin: fetchcolor (COLORNAME)
  98.      Return the pixel value corresponding to the given color name.
  99.      Return the default foreground color for unknown color names.
  100.      Hint: the following code tests wheter you are on a machine that
  101.      supports more than two colors:
  102.           if stdwin.fetchcolor('black') <> \
  103.                     stdwin.fetchcolor('red') <> \
  104.                     stdwin.fetchcolor('white'):
  105.               print 'color machine'
  106.           else:
  107.               print 'monochrome machine'
  108.  
  109.  - function of module stdwin: setfgcolor (PIXEL)
  110.      Set the default foreground color.  This will become the default
  111.      foreground color of windows opened subsequently, including dialogs.
  112.  
  113.  - function of module stdwin: setbgcolor (PIXEL)
  114.      Set the default background color.  This will become the default
  115.      background color of windows opened subsequently, including dialogs.
  116.  
  117.  - function of module stdwin: getfgcolor ()
  118.      Return the pixel value of the current default foreground color.
  119.  
  120.  - function of module stdwin: getbgcolor ()
  121.      Return the pixel value of the current default background color.
  122.  
  123.  - function of module stdwin: setfont (FONTNAME)
  124.      Set the current default font.  This will become the default font
  125.      for windows opened subsequently, and is also used by the text
  126.      measuring functions `textwidth', `textbreak', `lineheight' and
  127.      `baseline' below.  This accepts two more optional parameters, size
  128.      and style: Size is the font size (in `points').  Style is a single
  129.      character specifying the style, as follows: `'b'' = bold, `'i'' =
  130.      italic, `'o'' = bold + italic, `'u'' = underline; default style is
  131.      roman.  Size and style are ignored under X11 but used on the
  132.      Macintosh.  (Sorry for all this complexity -- a more uniform
  133.      interface is being designed.)
  134.  
  135.  - function of module stdwin: menucreate (TITLE)
  136.      Create a menu object referring to a global menu (a menu that
  137.      appears in all windows).  Methods of menu objects are described
  138.      below.  Note: normally, menus are created locally; see the window
  139.      method `menucreate' below.  *Warning:* the menu only appears in a
  140.      window as long as the object returned by this call exists.
  141.  
  142.  - function of module stdwin: newbitmap (WIDTH, HEIGHT)
  143.      Create a new bitmap object of the given dimensions.  Methods of
  144.      bitmap objects are described below.
  145.  
  146.  - function of module stdwin: fleep ()
  147.      Cause a beep or bell (or perhaps a `visual bell' or flash, hence
  148.      the name).
  149.  
  150.  - function of module stdwin: message (STRING)
  151.      Display a dialog box containing the string.  The user must click
  152.      OK before the function returns.
  153.  
  154.  - function of module stdwin: askync (PROMPT, DEFAULT)
  155.      Display a dialog that prompts the user to answer a question with
  156.      yes or no.  Return 0 for no, 1 for yes.  If the user hits the
  157.      Return key, the default (which must be 0 or 1) is returned.  If
  158.      the user cancels the dialog, the `KeyboardInterrupt' exception is
  159.      raised.
  160.  
  161.  - function of module stdwin: askstr (PROMPT, DEFAULT)
  162.      Display a dialog that prompts the user for a string.  If the user
  163.      hits the Return key, the default string is returned.  If the user
  164.      cancels the dialog, the `KeyboardInterrupt' exception is raised.
  165.  
  166.  - function of module stdwin: askfile (PROMPT, DEFAULT, NEW)
  167.      Ask the user to specify a filename.  If NEW is zero it must be an
  168.      existing file; otherwise, it must be a new file.  If the user
  169.      cancels the dialog, the `KeyboardInterrupt' exception is raised.
  170.  
  171.  - function of module stdwin: setcutbuffer (I, STRING)
  172.      Store the string in the system's cut buffer number I, where it can
  173.      be found (for pasting) by other applications.  On X11, there are 8
  174.      cut buffers (numbered 0..7).  Cut buffer number 0 is the
  175.      `clipboard' on the Macintosh.
  176.  
  177.  - function of module stdwin: getcutbuffer (I)
  178.      Return the contents of the system's cut buffer number I.
  179.  
  180.  - function of module stdwin: rotatecutbuffers (N)
  181.      On X11, rotate the 8 cut buffers by N.  Ignored on the Macintosh.
  182.  
  183.  - function of module stdwin: getselection (I)
  184.      Return X11 selection number I.  Selections are not cut buffers.
  185.      Selection numbers are defined in module `stdwinevents'.  Selection
  186.      `WS_PRIMARY' is the "primary" selection (used by xterm, for
  187.      instance); selection `WS_SECONDARY' is the "secondary" selection;
  188.      selection `WS_CLIPBOARD' is the "clipboard" selection (used by
  189.      xclipboard).  On the Macintosh, this always returns an empty
  190.      string.
  191.  
  192.  - function of module stdwin: resetselection (I)
  193.      Reset selection number I, if this process owns it.  (See window
  194.      method `setselection()').
  195.  
  196.  - function of module stdwin: baseline ()
  197.      Return the baseline of the current font (defined by STDWIN as the
  198.      vertical distance between the baseline and the top of the
  199.      characters).
  200.  
  201.  - function of module stdwin: lineheight ()
  202.      Return the total line height of the current font.
  203.  
  204.  - function of module stdwin: textbreak (STR, WIDTH)
  205.      Return the number of characters of the string that fit into a
  206.      space of WIDTH bits wide when drawn in the curent font.
  207.  
  208.  - function of module stdwin: textwidth (STR)
  209.      Return the width in bits of the string when drawn in the current
  210.      font.
  211.  
  212.  - function of module stdwin: connectionnumber ()
  213.  
  214.  - function of module stdwin: fileno ()
  215.      (X11 under UNIX only) Return the "connection number" used by the
  216.      underlying X11 implementation.  (This is normally the file number
  217.      of the socket.)  Both functions return the same value;
  218.      `connectionnumber()' is named after the corresponding function in
  219.      X11 and STDWIN, while `fileno()' makes it possible to use the
  220.      `stdwin' module as a "file" object parameter to `select.select()'.
  221.      Note that if `select()' implies that input is possible on
  222.      `stdwin', this does not guarantee that an event is ready -- it may
  223.      be some internal communication going on between the X server and
  224.      the client library.  Thus, you should call `stdwin.pollevent()'
  225.      until it returns `None' to check for events if you don't want your
  226.      program to block.  Because of internal buffering in X11, it is
  227.      also possible that `stdwin.pollevent()' returns an event while
  228.      `select()' does not find `stdwin' to be ready, so you should read
  229.      any pending events with `stdwin.pollevent()' until it returns
  230.      `None' before entering a blocking `select()' call.
  231.  
  232. ---------- Footnotes ----------
  233.  
  234. (1)  The Python version of STDWIN does not support draw procedures; all
  235. drawing requests are reported as draw events.
  236.  
  237. 
  238. File: python-lib.info,  Node: Window Object,  Next: Drawing Object,  Prev: Functions Defined in Module stdwin,  Up: stdwin
  239.  
  240. Window Object Methods
  241. ---------------------
  242.  
  243. Window objects are created by `stdwin.open()'.  They are closed by
  244. their `close()' method or when they are garbage-collected.  Window
  245. objects have the following methods:
  246.  
  247.  - Method on window: begindrawing ()
  248.      Return a drawing object, whose methods (described below) allow
  249.      drawing in the window.
  250.  
  251.  - Method on window: change (RECT)
  252.      Invalidate the given rectangle; this may cause a draw event.
  253.  
  254.  - Method on window: gettitle ()
  255.      Returns the window's title string.
  256.  
  257.  - Method on window: getdocsize ()
  258.      Return a pair of integers giving the size of the document as set by
  259.      `setdocsize()'.
  260.  
  261.  
  262.  - Method on window: getorigin ()
  263.      Return a pair of integers giving the origin of the window with
  264.      respect to the document.
  265.  
  266.  - Method on window: gettitle ()
  267.      Return the window's title string.
  268.  
  269.  - Method on window: getwinsize ()
  270.      Return a pair of integers giving the size of the window.
  271.  
  272.  - Method on window: getwinpos ()
  273.      Return a pair of integers giving the position of the window's upper
  274.      left corner (relative to the upper left corner of the screen).
  275.  
  276.  - Method on window: menucreate (TITLE)
  277.      Create a menu object referring to a local menu (a menu that appears
  278.      only in this window).  Methods of menu objects are described below.
  279.      Warning: the menu only appears as long as the object returned by
  280.      this call exists.
  281.  
  282.  - Method on window: scroll (RECT, POINT)
  283.      Scroll the given rectangle by the vector given by the point.
  284.  
  285.  - Method on window: setdocsize (POINT)
  286.      Set the size of the drawing document.
  287.  
  288.  - Method on window: setorigin (POINT)
  289.      Move the origin of the window (its upper left corner) to the given
  290.      point in the document.
  291.  
  292.  - Method on window: setselection (I, STR)
  293.      Attempt to set X11 selection number I to the string STR.  (See
  294.      stdwin method `getselection()' for the meaning of I.) Return true
  295.      if it succeeds.  If  succeeds, the window "owns" the selection
  296.      until (a) another applications takes ownership of the selection; or
  297.      (b) the window is deleted; or (c) the application clears ownership
  298.      by calling `stdwin.resetselection(I)'.  When another application
  299.      takes ownership of the selection, a `WE_LOST_SEL' event is
  300.      received for no particular window and with the selection number as
  301.      detail.  Ignored on the Macintosh.
  302.  
  303.  - Method on window: settimer (DSECS)
  304.      Schedule a timer event for the window in `DSECS/10' seconds.
  305.  
  306.  - Method on window: settitle (TITLE)
  307.      Set the window's title string.
  308.  
  309.  - Method on window: setwincursor (NAME)
  310.      Set the window cursor to a cursor of the given name.  It raises the
  311.      `RuntimeError' exception if no cursor of the given name exists.
  312.      Suitable names include `'ibeam'', `'arrow'', `'cross'', `'watch''
  313.      and `'plus''.  On X11, there are many more (see
  314.      `<X11/cursorfont.h>').
  315.  
  316.  
  317.  - Method on window: setwinpos (H, V)
  318.      Set the the position of the window's upper left corner (relative to
  319.      the upper left corner of the screen).
  320.  
  321.  - Method on window: setwinsize (WIDTH, HEIGHT)
  322.      Set the window's size.
  323.  
  324.  - Method on window: show (RECT)
  325.      Try to ensure that the given rectangle of the document is visible
  326.      in the window.
  327.  
  328.  - Method on window: textcreate (RECT)
  329.      Create a text-edit object in the document at the given rectangle.
  330.      Methods of text-edit objects are described below.
  331.  
  332.  - Method on window: setactive ()
  333.      Attempt to make this window the active window.  If successful, this
  334.      will generate a WE_ACTIVATE event (and a WE_DEACTIVATE event in
  335.      case another window in this application became inactive).
  336.  
  337.  - Method on window: close ()
  338.      Discard the window object.  It should not be used again.
  339.  
  340. 
  341. File: python-lib.info,  Node: Drawing Object,  Next: Menu Object,  Prev: Window Object,  Up: stdwin
  342.  
  343. Drawing Object Methods
  344. ----------------------
  345.  
  346. Drawing objects are created exclusively by the window method
  347. `begindrawing()'.  Only one drawing object can exist at any given time;
  348. the drawing object must be deleted to finish drawing.  No drawing
  349. object may exist when `stdwin.getevent()' is called.  Drawing objects
  350. have the following methods:
  351.  
  352.  - Method on drawing: box (RECT)
  353.      Draw a box just inside a rectangle.
  354.  
  355.  - Method on drawing: circle (CENTER, RADIUS)
  356.      Draw a circle with given center point and radius.
  357.  
  358.  - Method on drawing: elarc (CENTER, (RH, RV), (A1, A2))
  359.      Draw an elliptical arc with given center point.  `(RH, RV)' gives
  360.      the half sizes of the horizontal and vertical radii.  `(A1, A2)'
  361.      gives the angles (in degrees) of the begin and end points.  0
  362.      degrees is at 3 o'clock, 90 degrees is at 12 o'clock.
  363.  
  364.  - Method on drawing: erase (RECT)
  365.      Erase a rectangle.
  366.  
  367.  - Method on drawing: fillcircle (CENTER, RADIUS)
  368.      Draw a filled circle with given center point and radius.
  369.  
  370.  - Method on drawing: fillelarc (CENTER, (RH, RV), (A1, A2))
  371.      Draw a filled elliptical arc; arguments as for `elarc'.
  372.  
  373.  - Method on drawing: fillpoly (POINTS)
  374.      Draw a filled polygon given by a list (or tuple) of points.
  375.  
  376.  - Method on drawing: invert (RECT)
  377.      Invert a rectangle.
  378.  
  379.  - Method on drawing: line (P1, P2)
  380.      Draw a line from point P1 to P2.
  381.  
  382.  - Method on drawing: paint (RECT)
  383.      Fill a rectangle.
  384.  
  385.  - Method on drawing: poly (POINTS)
  386.      Draw the lines connecting the given list (or tuple) of points.
  387.  
  388.  - Method on drawing: shade (RECT, PERCENT)
  389.      Fill a rectangle with a shading pattern that is about PERCENT
  390.      percent filled.
  391.  
  392.  - Method on drawing: text (P, STR)
  393.      Draw a string starting at point p (the point specifies the top
  394.      left coordinate of the string).
  395.  
  396.  - Method on drawing: xorcircle (CENTER, RADIUS)
  397.  
  398.  - Method on drawing: xorelarc (CENTER, (RH, RV), (A1, A2))
  399.  
  400.  - Method on drawing: xorline (P1, P2)
  401.  
  402.  - Method on drawing: xorpoly (POINTS)
  403.      Draw a circle, an elliptical arc, a line or a polygon,
  404.      respectively, in XOR mode.
  405.  
  406.  - Method on drawing: setfgcolor ()
  407.  
  408.  - Method on drawing: setbgcolor ()
  409.  
  410.  - Method on drawing: getfgcolor ()
  411.  
  412.  - Method on drawing: getbgcolor ()
  413.      These functions are similar to the corresponding functions
  414.      described above for the `stdwin' module, but affect or return the
  415.      colors currently used for drawing instead of the global default
  416.      colors.  When a drawing object is created, its colors are set to
  417.      the window's default colors, which are in turn initialized from
  418.      the global default colors when the window is created.
  419.  
  420.  - Method on drawing: setfont ()
  421.  
  422.  - Method on drawing: baseline ()
  423.  
  424.  - Method on drawing: lineheight ()
  425.  
  426.  - Method on drawing: textbreak ()
  427.  
  428.  - Method on drawing: textwidth ()
  429.      These functions are similar to the corresponding functions
  430.      described above for the `stdwin' module, but affect or use the
  431.      current drawing font instead of the global default font.  When a
  432.      drawing object is created, its font is set to the window's default
  433.      font, which is in turn initialized from the global default font
  434.      when the window is created.
  435.  
  436.  - Method on drawing: bitmap (POINT, BITMAP, MASK)
  437.      Draw the BITMAP with its top left corner at POINT.  If the
  438.      optional MASK argument is present, it should be either the same
  439.      object as BITMAP, to draw only those bits that are set in the
  440.      bitmap, in the foreground color, or `None', to draw all bits (ones
  441.      are drawn in the foreground color, zeros in the background color).
  442.  
  443.  - Method on drawing: cliprect (RECT)
  444.      Set the "clipping region" to a rectangle.  The clipping region
  445.      limits the effect of all drawing operations, until it is changed
  446.      again or until the drawing object is closed.  When a drawing
  447.      object is created the clipping region is set to the entire window.
  448.      When an object to be drawn falls partly outside the clipping
  449.      region, the set of pixels drawn is the intersection of the clipping
  450.      region and the set of pixels that would be drawn by the same
  451.      operation in the absence of a clipping region.  clipping region
  452.  
  453.  - Method on drawing: noclip ()
  454.      Reset the clipping region to the entire window.
  455.  
  456.  - Method on drawing: close ()
  457.  
  458.  - Method on drawing: enddrawing ()
  459.      Discard the drawing object.  It should not be used again.
  460.  
  461. 
  462. File: python-lib.info,  Node: Menu Object,  Next: Bitmap Object,  Prev: Drawing Object,  Up: stdwin
  463.  
  464. Menu Object Methods
  465. -------------------
  466.  
  467. A menu object represents a menu.  The menu is destroyed when the menu
  468. object is deleted.  The following methods are defined:
  469.  
  470.  - Method on menu: additem (TEXT, SHORTCUT)
  471.      Add a menu item with given text.  The shortcut must be a string of
  472.      length 1, or omitted (to specify no shortcut).
  473.  
  474.  - Method on menu: setitem (I, TEXT)
  475.      Set the text of item number I.
  476.  
  477.  - Method on menu: enable (I, FLAG)
  478.      Enable or disables item I.
  479.  
  480.  - Method on menu: check (I, FLAG)
  481.      Set or clear the "check mark" for item I.
  482.  
  483.  - Method on menu: close ()
  484.      Discard the menu object.  It should not be used again.
  485.  
  486. 
  487. File: python-lib.info,  Node: Bitmap Object,  Next: Text-edit Object,  Prev: Menu Object,  Up: stdwin
  488.  
  489. Bitmap Object Methods
  490. ---------------------
  491.  
  492. A bitmap represents a rectangular array of bits.  The top left bit has
  493. coordinate (0, 0).  A bitmap can be drawn with the `bitmap' method of a
  494. drawing object.  The following methods are defined:
  495.  
  496.  - Method on bitmap: getsize ()
  497.      Return a tuple representing the width and height of the bitmap.
  498.      (This returns the values that have been passed to the `newbitmap'
  499.      function.)
  500.  
  501.  - Method on bitmap: setbit (POINT, BIT)
  502.      Set the value of the bit indicated by POINT to BIT.
  503.  
  504.  - Method on bitmap: getbit (POINT)
  505.      Return the value of the bit indicated by POINT.
  506.  
  507.  - Method on bitmap: close ()
  508.      Discard the bitmap object.  It should not be used again.
  509.  
  510. 
  511. File: python-lib.info,  Node: Text-edit Object,  Next: Stdwin Example,  Prev: Bitmap Object,  Up: stdwin
  512.  
  513. Text-edit Object Methods
  514. ------------------------
  515.  
  516. A text-edit object represents a text-edit block.  For semantics, see
  517. the STDWIN documentation for C programmers.  The following methods
  518. exist:
  519.  
  520.  - Method on text-edit: arrow (CODE)
  521.      Pass an arrow event to the text-edit block.  The CODE must be one
  522.      of `WC_LEFT', `WC_RIGHT', `WC_UP' or `WC_DOWN' (see module
  523.      `stdwinevents').
  524.  
  525.  - Method on text-edit: draw (RECT)
  526.      Pass a draw event to the text-edit block.  The rectangle specifies
  527.      the redraw area.
  528.  
  529.  - Method on text-edit: event (TYPE, WINDOW, DETAIL)
  530.      Pass an event gotten from `stdwin.getevent()' to the text-edit
  531.      block.  Return true if the event was handled.
  532.  
  533.  - Method on text-edit: getfocus ()
  534.      Return 2 integers representing the start and end positions of the
  535.      focus, usable as slice indices on the string returned by
  536.      `gettext()'.
  537.  
  538.  - Method on text-edit: getfocustext ()
  539.      Return the text in the focus.
  540.  
  541.  - Method on text-edit: getrect ()
  542.      Return a rectangle giving the actual position of the text-edit
  543.      block.  (The bottom coordinate may differ from the initial
  544.      position because the block automatically shrinks or grows to fit.)
  545.  
  546.  - Method on text-edit: gettext ()
  547.      Return the entire text buffer.
  548.  
  549.  - Method on text-edit: move (RECT)
  550.      Specify a new position for the text-edit block in the document.
  551.  
  552.  - Method on text-edit: replace (STR)
  553.      Replace the text in the focus by the given string.  The new focus
  554.      is an insert point at the end of the string.
  555.  
  556.  - Method on text-edit: setfocus (I, J)
  557.      Specify the new focus.  Out-of-bounds values are silently clipped.
  558.  
  559.  - Method on text-edit: settext (STR)
  560.      Replace the entire text buffer by the given string and set the
  561.      focus to `(0, 0)'.
  562.  
  563.  - Method on text-edit: setview (RECT)
  564.      Set the view rectangle to RECT.  If RECT is `None', viewing mode
  565.      is reset.  In viewing mode, all output from the text-edit object
  566.      is clipped to the viewing rectangle.  This may be useful to
  567.      implement your own scrolling text subwindow.
  568.  
  569.  - Method on text-edit: close ()
  570.      Discard the text-edit object.  It should not be used again.
  571.  
  572. 
  573. File: python-lib.info,  Node: Stdwin Example,  Prev: Text-edit Object,  Up: stdwin
  574.  
  575. Example
  576. -------
  577.  
  578. Here is a minimal example of using STDWIN in Python.  It creates a
  579. window and draws the string "Hello world" in the top left corner of the
  580. window.  The window will be correctly redrawn when covered and
  581. re-exposed.  The program quits when the close icon or menu item is
  582. requested.
  583.  
  584.      import stdwin
  585.      from stdwinevents import *
  586.      
  587.      def main():
  588.          mywin = stdwin.open('Hello')
  589.          #
  590.          while 1:
  591.              (type, win, detail) = stdwin.getevent()
  592.              if type == WE_DRAW:
  593.                  draw = win.begindrawing()
  594.                  draw.text((0, 0), 'Hello, world')
  595.                  del draw
  596.              elif type == WE_CLOSE:
  597.                  break
  598.      
  599.      main()
  600.  
  601. 
  602. File: python-lib.info,  Node: stdwinevents,  Next: rect,  Prev: stdwin,  Up: STDWIN ONLY
  603.  
  604. Standard Module `stdwinevents'
  605. ==============================
  606.  
  607. This module defines constants used by STDWIN for event types
  608. (`WE_ACTIVATE' etc.), command codes (`WC_LEFT' etc.) and selection
  609. types (`WS_PRIMARY' etc.).  Read the file for details.  Suggested usage
  610. is
  611.  
  612.      >>> from stdwinevents import *
  613.      >>>
  614.  
  615. 
  616. File: python-lib.info,  Node: rect,  Prev: stdwinevents,  Up: STDWIN ONLY
  617.  
  618. Standard Module `rect'
  619. ======================
  620.  
  621. This module contains useful operations on rectangles.  A rectangle is
  622. defined as in module `stdwin': a pair of points, where a point is a
  623. pair of integers.  For example, the rectangle
  624.  
  625.      (10, 20), (90, 80)
  626. is a rectangle whose left, top, right and bottom edges are 10, 20, 90
  627. and 80, respectively.  Note that the positive vertical axis points down
  628. (as in `stdwin').
  629.  
  630. The module defines the following objects:
  631.  
  632.  - exception of module rect: error
  633.      The exception raised by functions in this module when they detect
  634.      an error.  The exception argument is a string describing the
  635.      problem in more detail.
  636.  
  637.  - data of module rect: empty
  638.      The rectangle returned when some operations return an empty result.
  639.      This makes it possible to quickly check whether a result is empty:
  640.  
  641.           >>> import rect
  642.           >>> r1 = (10, 20), (90, 80)
  643.           >>> r2 = (0, 0), (10, 20)
  644.           >>> r3 = rect.intersect([r1, r2])
  645.           >>> if r3 is rect.empty: print 'Empty intersection'
  646.           Empty intersection
  647.           >>>
  648.  
  649.  - function of module rect: is_empty (R)
  650.      Returns true if the given rectangle is empty.  A rectangle `(LEFT,
  651.      TOP), (RIGHT, BOTTOM)' is empty if `LEFT >= RIGHT' or `TOP =>
  652.      BOTTOM'.
  653.  
  654.  - function of module rect: intersect (LIST)
  655.      Returns the intersection of all rectangles in the list argument.
  656.      It may also be called with a tuple argument.  Raises `rect.error'
  657.      if the list is empty.  Returns `rect.empty' if the intersection of
  658.      the rectangles is empty.
  659.  
  660.  - function of module rect: union (LIST)
  661.      Returns the smallest rectangle that contains all non-empty
  662.      rectangles in the list argument.  It may also be called with a
  663.      tuple argument or with two or more rectangles as arguments.
  664.      Returns `rect.empty' if the list is empty or all its rectangles
  665.      are empty.
  666.  
  667.  - function of module rect: pointinrect (POINT, RECT)
  668.      Returns true if the point is inside the rectangle.  By definition,
  669.      a point `(H, V)' is inside a rectangle `(LEFT, TOP), (RIGHT,
  670.      BOTTOM)' if `LEFT <= H < RIGHT' and `TOP <= V < BOTTOM'.
  671.  
  672.  - function of module rect: inset (RECT, (DH, DV))
  673.      Returns a rectangle that lies inside the `rect' argument by DH
  674.      pixels horizontally and DV pixels vertically.  If DH or DV is
  675.      negative, the result lies outside RECT.
  676.  
  677.  - function of module rect: rect2geom (RECT)
  678.      Converts a rectangle to geometry representation: `(LEFT, TOP),
  679.      (WIDTH, HEIGHT)'.
  680.  
  681.  - function of module rect: geom2rect (GEOM)
  682.      Converts a rectangle given in geometry representation back to the
  683.      standard rectangle representation `(LEFT, TOP), (RIGHT, BOTTOM)'.
  684.  
  685. 
  686. File: python-lib.info,  Node: SGI IRIX ONLY,  Next: SUNOS ONLY,  Prev: STDWIN ONLY,  Up: Top
  687.  
  688. SGI IRIX ONLY
  689. *************
  690.  
  691. The modules described in this chapter provide interfaces to features
  692. that are unique to SGI's IRIX operating system (versions 4 and 5).
  693.  
  694. * Menu:
  695.  
  696. * al::
  697. * AL (uppercase)::
  698. * fl::
  699. * FL (uppercase)::
  700. * flp::
  701. * fm::
  702. * gl::
  703. * Standard Modules GL and DEVICE::
  704. * imgfile::
  705.  
  706. 
  707. File: python-lib.info,  Node: al,  Next: AL (uppercase),  Prev: SGI IRIX ONLY,  Up: SGI IRIX ONLY
  708.  
  709. Built-in Module `al'
  710. ====================
  711.  
  712. This module provides access to the audio facilities of the Indigo and
  713. 4D/35 workstations, described in section 3A of the IRIX 4.0 man pages
  714. (and also available as an option in IRIX 3.3).  You'll need to read
  715. those man pages to understand what these functions do!  Some of the
  716. functions are not available in releases below 4.0.5.  Again, see the
  717. manual to check whether a specific function is available on your
  718. platform.
  719.  
  720. Symbolic constants from the C header file `<audio.h>' are defined in
  721. the standard module `AL', see below.
  722.  
  723. *Warning:* the current version of the audio library may dump core when
  724. bad argument values are passed rather than returning an error status.
  725. Unfortunately, since the precise circumstances under which this may
  726. happen are undocumented and hard to check, the Python interface can
  727. provide no protection against this kind of problems.  (One example is
  728. specifying an excessive queue size -- there is no documented upper
  729. limit.)
  730.  
  731. Module `al' defines the following functions:
  732.  
  733.  - function of module al: openport (NAME, DIRECTION, CONFIG)
  734.      Equivalent to the C function ALopenport().  The name and direction
  735.      arguments are strings.  The optional config argument is an opaque
  736.      configuration object as returned by `al.newconfig()'.  The return
  737.      value is an opaque port object; methods of port objects are
  738.      described below.
  739.  
  740.  - function of module al: newconfig ()
  741.      Equivalent to the C function ALnewconfig().  The return value is a
  742.      new opaque configuration object; methods of configuration objects
  743.      are described below.
  744.  
  745.  - function of module al: queryparams (DEVICE)
  746.      Equivalent to the C function ALqueryparams().  The device argument
  747.      is an integer.  The return value is a list of integers containing
  748.      the data returned by ALqueryparams().
  749.  
  750.  - function of module al: getparams (DEVICE, LIST)
  751.      Equivalent to the C function ALgetparams().  The device argument
  752.      is an integer.  The list argument is a list such as returned by
  753.      `queryparams'; it is modified in place (!).
  754.  
  755.  - function of module al: setparams (DEVICE, LIST)
  756.      Equivalent to the C function ALsetparams().  The device argument
  757.      is an integer.The list argument is a list such as returned by
  758.      `al.queryparams'.
  759.  
  760. Configuration objects (returned by `al.newconfig()' have the following
  761. methods:
  762.  
  763.  - Method on audio configuration object: getqueuesize ()
  764.      Return the queue size; equivalent to the C function
  765.      ALgetqueuesize().
  766.  
  767.  - Method on audio configuration object: setqueuesize (SIZE)
  768.      Set the queue size; equivalent to the C function ALsetqueuesize().
  769.  
  770.  - Method on audio configuration object: getwidth ()
  771.      Get the sample width; equivalent to the C function ALgetwidth().
  772.  
  773.  - Method on audio configuration object: getwidth (WIDTH)
  774.      Set the sample width; equivalent to the C function ALsetwidth().
  775.  
  776.  - Method on audio configuration object: getchannels ()
  777.      Get the channel count; equivalent to the C function
  778.      ALgetchannels().
  779.  
  780.  - Method on audio configuration object: setchannels (NCHANNELS)
  781.      Set the channel count; equivalent to the C function
  782.      ALsetchannels().
  783.  
  784.  - Method on audio configuration object: getsampfmt ()
  785.      Get the sample format; equivalent to the C function ALgetsampfmt().
  786.  
  787.  - Method on audio configuration object: setsampfmt (SAMPFMT)
  788.      Set the sample format; equivalent to the C function ALsetsampfmt().
  789.  
  790.  - Method on audio configuration object: getfloatmax ()
  791.      Get the maximum value for floating sample formats; equivalent to
  792.      the C function ALgetfloatmax().
  793.  
  794.  - Method on audio configuration object: setfloatmax (FLOATMAX)
  795.      Set the maximum value for floating sample formats; equivalent to
  796.      the C function ALsetfloatmax().
  797.  
  798. Port objects (returned by `al.openport()' have the following methods:
  799.  
  800.  - Method on audio port object: closeport ()
  801.      Close the port; equivalent to the C function ALcloseport().
  802.  
  803.  - Method on audio port object: getfd ()
  804.      Return the file descriptor as an int; equivalent to the C function
  805.      ALgetfd().
  806.  
  807.  - Method on audio port object: getfilled ()
  808.      Return the number of filled samples; equivalent to the C function
  809.      ALgetfilled().
  810.  
  811.  - Method on audio port object: getfillable ()
  812.      Return the number of fillable samples; equivalent to the C function
  813.      ALgetfillable().
  814.  
  815.  - Method on audio port object: readsamps (NSAMPLES)
  816.      Read a number of samples from the queue, blocking if necessary;
  817.      equivalent to the C function ALreadsamples.  The data is returned
  818.      as a string containing the raw data (e.g. 2 bytes per sample in
  819.      big-endian byte order (high byte, low byte) if you have set the
  820.      sample width to 2 bytes.
  821.  
  822.  - Method on audio port object: writesamps (SAMPLES)
  823.      Write samples into the queue, blocking if necessary; equivalent to
  824.      the C function ALwritesamples.  The samples are encoded as
  825.      described for the `readsamps' return value.
  826.  
  827.  - Method on audio port object: getfillpoint ()
  828.      Return the `fill point'; equivalent to the C function
  829.      ALgetfillpoint().
  830.  
  831.  - Method on audio port object: setfillpoint (FILLPOINT)
  832.      Set the `fill point'; equivalent to the C function
  833.      ALsetfillpoint().
  834.  
  835.  - Method on audio port object: getconfig ()
  836.      Return a configuration object containing the current configuration
  837.      of the port; equivalent to the C function ALgetconfig().
  838.  
  839.  - Method on audio port object: setconfig (CONFIG)
  840.      Set the configuration from the argument, a configuration object;
  841.      equivalent to the C function ALsetconfig().
  842.  
  843.  - Method on audio port object: getstatus (LIST)
  844.      Get status information on last error equivalent to C function
  845.      ALgetstatus().
  846.  
  847. 
  848. File: python-lib.info,  Node: AL (uppercase),  Next: fl,  Prev: al,  Up: SGI IRIX ONLY
  849.  
  850. Standard Module `AL'
  851. ====================
  852.  
  853. This module defines symbolic constants needed to use the built-in
  854. module `al' (see above); they are equivalent to those defined in the C
  855. header file `<audio.h>' except that the name prefix `AL_' is omitted.
  856. Read the module source for a complete list of the defined names.
  857. Suggested use:
  858.  
  859.      import al
  860.      from AL import *
  861.  
  862. 
  863. File: python-lib.info,  Node: fl,  Next: FL (uppercase),  Prev: AL (uppercase),  Up: SGI IRIX ONLY
  864.  
  865. Built-in Module `fl'
  866. ====================
  867.  
  868. This module provides an interface to the FORMS Library by Mark
  869. Overmars, version 2.0b.  For more info about FORMS, write to
  870. markov@cs.ruu.nl.
  871.  
  872. Most functions are literal translations of their C equivalents,
  873. dropping the initial `fl_' from their name.  Constants used by the
  874. library are defined in module `FL' described below.
  875.  
  876. The creation of objects is a little different in Python than in C:
  877. instead of the `current form' maintained by the library to which new
  878. FORMS objects are added, all functions that add a FORMS object to a
  879. button are methods of the Python object representing the form.
  880. Consequently, there are no Python equivalents for the C functions
  881. `fl_addto_form' and `fl_end_form', and the equivalent of `fl_bgn_form'
  882. is called `fl.make_form'.
  883.  
  884. Watch out for the somewhat confusing terminology: FORMS uses the word
  885. "object" for the buttons, sliders etc. that you can place in a form.
  886. In Python, `object' means any value.  The Python interface to FORMS
  887. introduces two new Python object types: form objects (representing an
  888. entire form) and FORMS objects (representing one button, slider etc.).
  889. Hopefully this isn't too confusing...
  890.  
  891. There are no `free objects' in the Python interface to FORMS, nor is
  892. there an easy way to add object classes written in Python.  The FORMS
  893. interface to GL event handling is avaiable, though, so you can mix
  894. FORMS with pure GL windows.
  895.  
  896. *Please note:* importing `fl' implies a call to the GL function
  897. `foreground()' and to the FORMS routine `fl_init()'.
  898.  
  899. * Menu:
  900.  
  901. * Functions defined in module fl::
  902. * Form object::
  903. * FORMS object::
  904.  
  905. 
  906. File: python-lib.info,  Node: Functions defined in module fl,  Next: Form object,  Prev: fl,  Up: fl
  907.  
  908. Functions defined in module `fl'
  909. --------------------------------
  910.  
  911. Module `fl' defines the following functions.  For more information
  912. about what they do, see the description of the equivalent C function in
  913. the FORMS documentation:
  914.  
  915.  - function of module fl: make_form (TYPE, WIDTH, HEIGHT)
  916.      Create a form with given type, width and height.  This returns a
  917.      "form" object, whose methods are described below.
  918.  
  919.  - function of module fl: do_forms ()
  920.      The standard FORMS main loop.  Returns a Python object representing
  921.      the FORMS object needing interaction, or the special value
  922.      `FL.EVENT'.
  923.  
  924.  - function of module fl: check_forms ()
  925.      Check for FORMS events.  Returns what `do_forms' above returns, or
  926.      `None' if there is no event that immediately needs interaction.
  927.  
  928.  - function of module fl: set_event_call_back (FUNCTION)
  929.      Set the event callback function.
  930.  
  931.  - function of module fl: set_graphics_mode (RGBMODE, DOUBLEBUFFERING)
  932.      Set the graphics modes.
  933.  
  934.  - function of module fl: get_rgbmode ()
  935.      Return the current rgb mode.  This is the value of the C global
  936.      variable `fl_rgbmode'.
  937.  
  938.  - function of module fl: show_message (STR1, STR2, STR3)
  939.      Show a dialog box with a three-line message and an OK button.
  940.  
  941.  - function of module fl: show_question (STR1, STR2, STR3)
  942.      Show a dialog box with a three-line message and YES and NO buttons.
  943.      It returns `1' if the user pressed YES, `0' if NO.
  944.  
  945.  - function of module fl: show_choice (STR1, STR2, STR3, BUT1, BUT2,
  946.           BUT3)
  947.      Show a dialog box with a three-line message and up to three
  948.      buttons.  It returns the number of the button clicked by the user
  949.      (`1', `2' or `3').  The BUT2 and BUT3 arguments are optional.
  950.  
  951.  - function of module fl: show_input (PROMPT, DEFAULT)
  952.      Show a dialog box with a one-line prompt message and text field in
  953.      which the user can enter a string.  The second argument is the
  954.      default input string.  It returns the string value as edited by
  955.      the user.
  956.  
  957.  - function of module fl: show_file_selector (MESSAGE, DIRECTORY,
  958.           PATTERN, DEFAULT)
  959.      Show a dialog box inm which the user can select a file.  It returns
  960.      the absolute filename selected by the user, or `None' if the user
  961.      presses Cancel.
  962.  
  963.  - function of module fl: get_directory ()
  964.  
  965.  - function of module fl: get_pattern ()
  966.  
  967.  - function of module fl: get_filename ()
  968.      These functions return the directory, pattern and filename (the
  969.      tail part only) selected by the user in the last
  970.      `show_file_selector' call.
  971.  
  972.  - function of module fl: qdevice (DEV)
  973.  
  974.  - function of module fl: unqdevice (DEV)
  975.  
  976.  - function of module fl: isqueued (DEV)
  977.  
  978.  - function of module fl: qtest ()
  979.  
  980.  - function of module fl: qread ()
  981.  
  982.  - function of module fl: qreset ()
  983.  
  984.  - function of module fl: qenter (DEV, VAL)
  985.  
  986.  - function of module fl: get_mouse ()
  987.  
  988.  - function of module fl: tie (BUTTON, VALUATOR1, VALUATOR2)
  989.      These functions are the FORMS interfaces to the corresponding GL
  990.      functions.  Use these if you want to handle some GL events yourself
  991.      when using `fl.do_events'.  When a GL event is detected that FORMS
  992.      cannot handle, `fl.do_forms()' returns the special value
  993.      `FL.EVENT' and you should call `fl.qread()' to read the event from
  994.      the queue.  Don't use the equivalent GL functions!
  995.  
  996.  - function of module fl: color ()
  997.  
  998.  - function of module fl: mapcolor ()
  999.  
  1000.  - function of module fl: getmcolor ()
  1001.      See the description in the FORMS documentation of `fl_color',
  1002.      `fl_mapcolor' and `fl_getmcolor'.
  1003.  
  1004. 
  1005. File: python-lib.info,  Node: Form object,  Next: FORMS object,  Prev: Functions defined in module fl,  Up: fl
  1006.  
  1007. Form object methods and data attributes
  1008. ---------------------------------------
  1009.  
  1010. Form objects (returned by `fl.make_form()' above) have the following
  1011. methods.  Each method corresponds to a C function whose name is
  1012. prefixed with `fl_'; and whose first argument is a form pointer; please
  1013. refer to the official FORMS documentation for descriptions.
  1014.  
  1015. All the `add_...' functions return a Python object representing the
  1016. FORMS object.  Methods of FORMS objects are described below.  Most
  1017. kinds of FORMS object also have some methods specific to that kind;
  1018. these methods are listed here.
  1019.  
  1020.  - Method on form object: show_form (PLACEMENT, BORDERTYPE, NAME)
  1021.      Show the form.
  1022.  
  1023.  - Method on form object: hide_form ()
  1024.      Hide the form.
  1025.  
  1026.  - Method on form object: redraw_form ()
  1027.      Redraw the form.
  1028.  
  1029.  - Method on form object: set_form_position (X, Y)
  1030.      Set the form's position.
  1031.  
  1032.  - Method on form object: freeze_form ()
  1033.      Freeze the form.
  1034.  
  1035.  - Method on form object: unfreeze_form ()
  1036.      Unfreeze the form.
  1037.  
  1038.  - Method on form object: activate_form ()
  1039.      Activate the form.
  1040.  
  1041.  - Method on form object: deactivate_form ()
  1042.      Deactivate the form.
  1043.  
  1044.  - Method on form object: bgn_group ()
  1045.      Begin a new group of objects; return a group object.
  1046.  
  1047.  - Method on form object: end_group ()
  1048.      End the current group of objects.
  1049.  
  1050.  - Method on form object: find_first ()
  1051.      Find the first object in the form.
  1052.  
  1053.  - Method on form object: find_last ()
  1054.      Find the last object in the form.
  1055.  
  1056.  - Method on form object: add_box (TYPE, X, Y, W, H, NAME)
  1057.      Add a box object to the form.  No extra methods.
  1058.  
  1059.  - Method on form object: add_text (TYPE, X, Y, W, H, NAME)
  1060.      Add a text object to the form.  No extra methods.
  1061.  
  1062.  - Method on form object: add_clock (TYPE, X, Y, W, H, NAME)
  1063.      Add a clock object to the form.
  1064.      Method: `get_clock'.
  1065.  
  1066.  - Method on form object: add_button (TYPE, X, Y, W, H, NAME)
  1067.      Add a button object to the form.
  1068.      Methods: `get_button', `set_button'.
  1069.  
  1070.  - Method on form object: add_lightbutton (TYPE, X, Y, W, H, NAME)
  1071.      Add a lightbutton object to the form.
  1072.      Methods: `get_button', `set_button'.
  1073.  
  1074.  - Method on form object: add_roundbutton (TYPE, X, Y, W, H, NAME)
  1075.      Add a roundbutton object to the form.
  1076.      Methods: `get_button', `set_button'.
  1077.  
  1078.  - Method on form object: add_slider (TYPE, X, Y, W, H, NAME)
  1079.      Add a slider object to the form.
  1080.      Methods: `set_slider_value', `get_slider_value',
  1081.      `set_slider_bounds', `get_slider_bounds', `set_slider_return',
  1082.      `set_slider_size', `set_slider_precision', `set_slider_step'.
  1083.  
  1084.  - Method on form object: add_valslider (TYPE, X, Y, W, H, NAME)
  1085.      Add a valslider object to the form.
  1086.      Methods: `set_slider_value', `get_slider_value',
  1087.      `set_slider_bounds', `get_slider_bounds', `set_slider_return',
  1088.      `set_slider_size', `set_slider_precision', `set_slider_step'.
  1089.  
  1090.  - Method on form object: add_dial (TYPE, X, Y, W, H, NAME)
  1091.      Add a dial object to the form.
  1092.      Methods: `set_dial_value', `get_dial_value', `set_dial_bounds',
  1093.      `get_dial_bounds'.
  1094.  
  1095.  - Method on form object: add_positioner (TYPE, X, Y, W, H, NAME)
  1096.      Add a positioner object to the form.
  1097.      Methods: `set_positioner_xvalue', `set_positioner_yvalue',
  1098.      `set_positioner_xbounds', `set_positioner_ybounds',
  1099.      `get_positioner_xvalue', `get_positioner_yvalue',
  1100.      `get_positioner_xbounds', `get_positioner_ybounds'.
  1101.  
  1102.  - Method on form object: add_counter (TYPE, X, Y, W, H, NAME)
  1103.      Add a counter object to the form.
  1104.      Methods: `set_counter_value', `get_counter_value',
  1105.      `set_counter_bounds', `set_counter_step', `set_counter_precision',
  1106.      `set_counter_return'.
  1107.  
  1108.  - Method on form object: add_input (TYPE, X, Y, W, H, NAME)
  1109.      Add a input object to the form.
  1110.      Methods: `set_input', `get_input', `set_input_color',
  1111.      `set_input_return'.
  1112.  
  1113.  - Method on form object: add_menu (TYPE, X, Y, W, H, NAME)
  1114.      Add a menu object to the form.
  1115.      Methods: `set_menu', `get_menu', `addto_menu'.
  1116.  
  1117.  - Method on form object: add_choice (TYPE, X, Y, W, H, NAME)
  1118.      Add a choice object to the form.
  1119.      Methods: `set_choice', `get_choice', `clear_choice',
  1120.      `addto_choice', `replace_choice', `delete_choice',
  1121.      `get_choice_text', `set_choice_fontsize', `set_choice_fontstyle'.
  1122.  
  1123.  - Method on form object: add_browser (TYPE, X, Y, W, H, NAME)
  1124.      Add a browser object to the form.
  1125.      Methods: `set_browser_topline', `clear_browser',
  1126.      `add_browser_line', `addto_browser', `insert_browser_line',
  1127.      `delete_browser_line', `replace_browser_line', `get_browser_line',
  1128.      `load_browser', `get_browser_maxline', `select_browser_line',
  1129.      `deselect_browser_line', `deselect_browser',
  1130.      `isselected_browser_line', `get_browser', `set_browser_fontsize',
  1131.      `set_browser_fontstyle', `set_browser_specialkey'.
  1132.  
  1133.  - Method on form object: add_timer (TYPE, X, Y, W, H, NAME)
  1134.      Add a timer object to the form.
  1135.      Methods: `set_timer', `get_timer'.
  1136.  
  1137. Form objects have the following data attributes; see the FORMS
  1138. documentation:
  1139.  
  1140. *Name*
  1141.      *Type*  --  *Meaning*
  1142.  
  1143. `window'
  1144.      int (read-only)  --  GL window id
  1145.  
  1146. `w'
  1147.      float  --  form width
  1148.  
  1149. `h'
  1150.      float  --  form height
  1151.  
  1152. `x'
  1153.      float  --  form x origin
  1154.  
  1155. `y'
  1156.      float  --  form y origin
  1157.  
  1158. `deactivated'
  1159.      int  --  nonzero if form is deactivated
  1160.  
  1161. `visible'
  1162.      int  --  nonzero if form is visible
  1163.  
  1164. `frozen'
  1165.      int  --  nonzero if form is frozen
  1166.  
  1167. `doublebuf'
  1168.      int  --  nonzero if double buffering on
  1169.  
  1170. 
  1171. File: python-lib.info,  Node: FORMS object,  Prev: Form object,  Up: fl
  1172.  
  1173. FORMS object methods and data attributes
  1174. ----------------------------------------
  1175.  
  1176. Besides methods specific to particular kinds of FORMS objects, all
  1177. FORMS objects also have the following methods:
  1178.  
  1179.  - Method on FORMS object: set_call_back (FUNCTION, ARGUMENT)
  1180.      Set the object's callback function and argument.  When the object
  1181.      needs interaction, the callback function will be called with two
  1182.      arguments: the object, and the callback argument.  (FORMS objects
  1183.      without a callback function are returned by `fl.do_forms()' or
  1184.      `fl.check_forms()' when they need interaction.)  Call this method
  1185.      without arguments to remove the callback function.
  1186.  
  1187.  - Method on FORMS object: delete_object ()
  1188.      Delete the object.
  1189.  
  1190.  - Method on FORMS object: show_object ()
  1191.      Show the object.
  1192.  
  1193.  - Method on FORMS object: hide_object ()
  1194.      Hide the object.
  1195.  
  1196.  - Method on FORMS object: redraw_object ()
  1197.      Redraw the object.
  1198.  
  1199.  - Method on FORMS object: freeze_object ()
  1200.      Freeze the object.
  1201.  
  1202.  - Method on FORMS object: unfreeze_object ()
  1203.      Unfreeze the object.
  1204.  
  1205. FORMS objects have these data attributes; see the FORMS documentation:
  1206.  
  1207. *Name*
  1208.      *Type*  --  *Meaning*
  1209.  
  1210. `objclass'
  1211.      int (read-only)  --  object class
  1212.  
  1213. `type'
  1214.      int (read-only)  --  object type
  1215.  
  1216. `boxtype'
  1217.      int  --  box type
  1218.  
  1219. `x'
  1220.      float  --  x origin
  1221.  
  1222. `y'
  1223.      float  --  y origin
  1224.  
  1225. `w'
  1226.      float  --  width
  1227.  
  1228. `h'
  1229.      float  --  height
  1230.  
  1231. `col1'
  1232.      int  --  primary color
  1233.  
  1234. `col2'
  1235.      int  --  secondary color
  1236.  
  1237. `align'
  1238.      int  --  alignment
  1239.  
  1240. `lcol'
  1241.      int  --  label color
  1242.  
  1243. `lsize'
  1244.      float  --  label font size
  1245.  
  1246. `label'
  1247.      string  --  label string
  1248.  
  1249. `lstyle'
  1250.      int  --  label style
  1251.  
  1252. `pushed'
  1253.      int (read-only)  --  (see FORMS docs)
  1254.  
  1255. `focus'
  1256.      int (read-only)  --  (see FORMS docs)
  1257.  
  1258. `belowmouse'
  1259.      int (read-only)  --  (see FORMS docs)
  1260.  
  1261. `frozen'
  1262.      int (read-only)  --  (see FORMS docs)
  1263.  
  1264. `active'
  1265.      int (read-only)  --  (see FORMS docs)
  1266.  
  1267. `input'
  1268.      int (read-only)  --  (see FORMS docs)
  1269.  
  1270. `visible'
  1271.      int (read-only)  --  (see FORMS docs)
  1272.  
  1273. `radio'
  1274.      int (read-only)  --  (see FORMS docs)
  1275.  
  1276. `automatic'
  1277.      int (read-only)  --  (see FORMS docs)
  1278.  
  1279. 
  1280. File: python-lib.info,  Node: FL (uppercase),  Next: flp,  Prev: fl,  Up: SGI IRIX ONLY
  1281.  
  1282. Standard Module `FL'
  1283. ====================
  1284.  
  1285. This module defines symbolic constants needed to use the built-in
  1286. module `fl' (see above); they are equivalent to those defined in the C
  1287. header file `<forms.h>' except that the name prefix `FL_' is omitted.
  1288. Read the module source for a complete list of the defined names.
  1289. Suggested use:
  1290.  
  1291.      import fl
  1292.      from FL import *
  1293.  
  1294. 
  1295. File: python-lib.info,  Node: flp,  Next: fm,  Prev: FL (uppercase),  Up: SGI IRIX ONLY
  1296.  
  1297. Standard Module `flp'
  1298. =====================
  1299.  
  1300. This module defines functions that can read form definitions created by
  1301. the `form designer' (`fdesign') program that comes with the FORMS
  1302. library (see module `fl' above).
  1303.  
  1304. For now, see the file `flp.doc' in the Python library source directory
  1305. for a description.
  1306.  
  1307. XXX A complete description should be inserted here!
  1308.  
  1309. 
  1310. File: python-lib.info,  Node: fm,  Next: gl,  Prev: flp,  Up: SGI IRIX ONLY
  1311.  
  1312. Built-in Module `fm'
  1313. ====================
  1314.  
  1315. This module provides access to the IRIS *Font Manager* library.  It is
  1316. available only on Silicon Graphics machines.  See also: 4Sight User's
  1317. Guide, Section 1, Chapter 5: Using the IRIS Font Manager.
  1318.  
  1319. This is not yet a full interface to the IRIS Font Manager.  Among the
  1320. unsupported features are: matrix operations; cache operations;
  1321. character operations (use string operations instead); some details of
  1322. font info; individual glyph metrics; and printer matching.
  1323.  
  1324. It supports the following operations:
  1325.  
  1326.  - function of module fm: init ()
  1327.      Initialization function.  Calls `fminit()'.  It is normally not
  1328.      necessary to call this function, since it is called automatically
  1329.      the first time the `fm' module is imported.
  1330.  
  1331.  - function of module fm: findfont (FONTNAME)
  1332.      Return a font handle object.  Calls `fmfindfont(FONTNAME)'.
  1333.  
  1334.  - function of module fm: enumerate ()
  1335.      Returns a list of available font names.  This is an interface to
  1336.      `fmenumerate()'.
  1337.  
  1338.  - function of module fm: prstr (STRING)
  1339.      Render a string using the current font (see the `setfont()' font
  1340.      handle method below).  Calls `fmprstr(STRING)'.
  1341.  
  1342.  - function of module fm: setpath (STRING)
  1343.      Sets the font search path.  Calls `fmsetpath(string)'.  (XXX Does
  1344.      not work!?!)
  1345.  
  1346.  - function of module fm: fontpath ()
  1347.      Returns the current font search path.
  1348.  
  1349. Font handle objects support the following operations:
  1350.  
  1351.  - Method on font handle: scalefont (FACTOR)
  1352.      Returns a handle for a scaled version of this font.  Calls
  1353.      `fmscalefont(FH, FACTOR)'.
  1354.  
  1355.  - Method on font handle: setfont ()
  1356.      Makes this font the current font.  Note: the effect is undone
  1357.      silently when the font handle object is deleted.  Calls
  1358.      `fmsetfont(FH)'.
  1359.  
  1360.  - Method on font handle: getfontname ()
  1361.      Returns this font's name.  Calls `fmgetfontname(FH)'.
  1362.  
  1363.  - Method on font handle: getcomment ()
  1364.      Returns the comment string associated with this font.  Raises an
  1365.      exception if there is none.  Calls `fmgetcomment(FH)'.
  1366.  
  1367.  - Method on font handle: getfontinfo ()
  1368.      Returns a tuple giving some pertinent data about this font.  This
  1369.      is an interface to `fmgetfontinfo()'.  The returned tuple contains
  1370.      the following numbers: `(PRINTERMATCHED, FIXED_WIDTH, XORIG,
  1371.      YORIG, XSIZE, YSIZE, HEIGHT, NGLYPHS)'.
  1372.  
  1373.  - Method on font handle: getstrwidth (STRING)
  1374.      Returns the width, in pixels, of the string when drawn in this
  1375.      font.  Calls `fmgetstrwidth(FH, STRING)'.
  1376.  
  1377.