org.gnome.gtk

## Class TextWindowType

- Object
- - org.freedesktop.bindings.Constant
  - - org.gnome.gtk.TextWindowType

-     public final class TextWindowType
      extends org.freedesktop.bindings.Constant

  Each TextView is actually composed from a number of underlying [org.gnome.gdk] Windows. In addition to the core one where the text entry happens, there are a number of optional Windows which can be used as side panels. This class specifies constants identifying these underlying resources.

  The `TEXT` Window is where most of the work happens; use Textview's `getWindow(TEXT)` rather than Widget's `getWindow()` and can be used if you need to work out relative positioning.

  On the other hand there are border windows, specified by `LEFT`, `TOP`, etc. These border Windows are an obscure, advanced, and not wholly functional feature of GTK. The accompanying illustration is a TextView with each border window specified to a width of 50 pixels and a Label placed at window co-ordinates `0`,`0` in each one. Code to create this snapshot consisted of a series of calls like:

       left = new Label("LEFT");
       view.setBorderWindowSize(TextWindowType.LEFT, 50);
       view.add(left, TextWindowType.LEFT, 0, 0);

  one for each side. Note the positions and relative sizes of the scrollbars added by the ScrolledWindow into which the TextView was placed. As you can see, only the left border window one makes very much sense, as it could be used for things like breakpoint annotations in a programming editor.

  WARNING
  By all accounts, this feature is still evolving in GTK; it is entirely possible that it was not completely implemented in the first place, and in any case the interface for using it seems ... unsteady. We have included this in java-gnome largely because we had already gone to all the work of exposing it only to discover that it is exceedingly hard to use and somewhat buggy. Hopefully GTK will improve, but if you use this, expect the behaviour to be somewhat unpredictable.

  Since:
    4.0.9
  Author:
    Andrew Cowie

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static TextWindowType` | `BOTTOM` The optional border Window below a TextView.
    `static TextWindowType` | `LEFT` The optional border Window on the left hand side of a TextView.
    `static TextWindowType` | `RIGHT` The optional border Window on the left hand side of a TextView.
    `static TextWindowType` | `TEXT` The main part of the TextView which displays the text to the user.
    `static TextWindowType` | `TOP` The optional border Window above a TextView.

  - ### Method Summary

    - ### Methods inherited from class org.freedesktop.bindings.Constant

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### BOTTOM

          public static TextWindowType BOTTOM

      The optional border Window below a TextView.
      Since:
        4.0.9

    - #### LEFT

          public static TextWindowType LEFT

      The optional border Window on the left hand side of a TextView. This is the interesting one, as you can use it to place annotations relating to the line of text being shown in the TextView beside it. Tying this to scrolling (if enabled) is very tricky, though. See FIXME for an example.
      Since:
        4.0.9

    - #### RIGHT

          public static TextWindowType RIGHT

      The optional border Window on the left hand side of a TextView.
      Since:
        4.0.9

    - #### TEXT

          public static TextWindowType TEXT

      The main part of the TextView which displays the text to the user. This is, quite likely, the only Window you will need to get at.
      Since:
        4.0.9

    - #### TOP

          public static TextWindowType TOP

      The optional border Window above a TextView.
      Since:
        4.0.9