org.gnome.gtk

## Class Paned

- Object
- - org.freedesktop.bindings.Pointer
  - - org.freedesktop.bindings.Proxy
    - - org.gnome.glib.Object
      - - org.gnome.gtk.Widget
        - - org.gnome.gtk.Container
          - - org.gnome.gtk.Paned

- All Implemented Interfaces:
    Orientable
  Direct Known Subclasses:
    HPaned, VPaned

      public class Paned
      extends Container
      implements Orientable

  Base type for Containers that dispose child Widgets in two panes, arranged either horizontally (`HPaned`) or vertically (`VPaned`). A Paned will have two children, referred as child `1` and `2`.

  This Widget is mainly used to divide the Window area in two parts. The user can adjust the size of the panes by dragging the separator that appears between them. This way, the user can choose at any time how much size allocate for each of the two child Widgets.

  A typical usage of the Paned Container is to provide some kind of navigator facilities to a application, generally with a list of bookmarks or an index. In those cases, a HPaned is used to divide the application Window in two columns, one at the left, with the index in a TreeView, and another, wider, at the right, with the contents.

  Note that Paned should only be used when we really need to allow users to dynamically change the way size is distributed between the two children. Otherwise, a `HBox` or `VBox` would be a better choice.

  Since:
    4.0.7
  Author:
    Vreixo Formoso

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.gnome.gtk.Widget

      `Widget.ButtonPressEvent, Widget.ButtonReleaseEvent, Widget.Destroy, Widget.Draw, Widget.EnterNotifyEvent, Widget.FocusInEvent, Widget.FocusOutEvent, Widget.Hide, Widget.KeyPressEvent, Widget.KeyReleaseEvent, Widget.LeaveNotifyEvent, Widget.MapEvent, Widget.MotionNotifyEvent, Widget.PopupMenu, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Paned(Orientation orientation)` Construct a new Paned of the given orientation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add1(Widget child)` Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.
    `void` | `add2(Widget child)` Adds a child Widget to the bottom (in case of VPaned) or to the right (in case of HPaned) pane.
    `Widget` | `getChild1()` Get the child Widget in the top (in case of a VPaned) or in the left (in case of an HPaned) pane.
    `Widget` | `getChild2()` Get the child Widget at the bottom (in case of VPaned) or at the right (in case of HPaned) pane.
    `Orientation` | `getOrientation()` Get the orientation of this Orientable.
    `int` | `getPosition()` Obtains the position of the divider between the two panes.
    `void` | `pack1(Widget child, boolean resize, boolean shrink)` Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.
    `void` | `pack2(Widget child, boolean resize, boolean shrink)` Adds a child Widget to the bottom (in case of a VPaned) or to the right (in case of an HPaned) pane.
    `void` | `setOrientation(Orientation orientation)` Set the orientation of this Orientable.
    `void` | `setPosition(int position)` Sets the position of the divider between the two panes.

    - ### Methods inherited from class org.gnome.gtk.Container

      `add, getChildren, remove, setBorderWidth`

    - ### Methods inherited from class org.gnome.gtk.Widget

      `activate, addEvents, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, connect, destroy, getAllocatedHeight, getAllocatedWidth, getAllocation, getCanDefault, getCanFocus, getHasFocus, getName, getParent, getPreferredHeightForWidthMinimum, getPreferredHeightForWidthNatural, getPreferredHeightMinimum, getPreferredHeightNatural, getPreferredWidthForHeightMinimum, getPreferredWidthForHeightNatural, getPreferredWidthMinimum, getPreferredWidthNatural, getRequestMode, getRequisition, getSensitive, getStyleContext, getToplevel, getWindow, grabAdd, grabDefault, grabFocus, grabRemove, hide, isSensitive, overrideBackground, overrideColor, overrideFont, queueDraw, queueDrawArea, realize, setAlignHorizontal, setAlignVertical, setCanDefault, setCanFocus, setEvents, setExpandHorizontal, setExpandVertical, setName, setSensitive, setSizeRequest, setTooltipMarkup, setTooltipText, show, showAll`

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

      `toString`

    - ### Methods inherited from class Object

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

- - ### Constructor Detail

    - #### Paned

          public Paned(Orientation orientation)

      Construct a new Paned of the given orientation. See also the original Widgets `HPaned` and `VPaned`.
      Since:
        4.1.1

  - ### Method Detail

    - #### add1

          public void add1(Widget child)

      Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.

      This call is equivalent to `pack1(child, false, true)`.

      Since:
        4.0.7

    - #### add2

          public void add2(Widget child)

      Adds a child Widget to the bottom (in case of VPaned) or to the right (in case of HPaned) pane.

      This call is equivalent to `pack2(child, false, true)`.

      Since:
        4.0.7

    - #### getChild1

          public Widget getChild1()

      Get the child Widget in the top (in case of a VPaned) or in the left (in case of an HPaned) pane.
      Since:
        4.0.7

    - #### getChild2

          public Widget getChild2()

      Get the child Widget at the bottom (in case of VPaned) or at the right (in case of HPaned) pane.
      Since:
        4.0.7

    - #### getOrientation

          public Orientation getOrientation()

      Description copied from interface: `Orientable`
      Get the orientation of this Orientable.
      Specified by:
        `getOrientation` in interface `Orientable`

    - #### getPosition

          public int getPosition()

      Obtains the position of the divider between the two panes.
      Returns:
        the position in pixels.

    - #### pack1

          public void pack1(Widget child,
                   boolean resize,
                   boolean shrink)

      Adds a child Widget to the top (in case of VPaned) or to the left (in case of HPaned) pane.
      Parameters:
        `child` - the Widget to be added
        `resize` - Whether this pane (and thus its Widget) should be resized when the Paned is resize.
        `shrink` - Whether the user can make the pane smaller than the size requested by the child Widget. This can be useful to let the user hide one of the two panels, but depending of the child Widget type it can lead to poor visual results. Use with caution.
      Since:
        4.0.7

    - #### pack2

          public void pack2(Widget child,
                   boolean resize,
                   boolean shrink)

      Adds a child Widget to the bottom (in case of a VPaned) or to the right (in case of an HPaned) pane. See `pack1()` for details.
      Since:
        4.0.7

    - #### setOrientation

          public void setOrientation(Orientation orientation)

      Description copied from interface: `Orientable`
      Set the orientation of this Orientable.
      Specified by:
        `setOrientation` in interface `Orientable`

    - #### setPosition

          public void setPosition(int position)

      Sets the position of the divider between the two panes.

      Note that the main utility of a Paned is to let user to set the position, so in most cases you don't want to call this method. It can be useful to set the initial position, if you feel that the default value chosen by Gtk is not suitable for your application.

      Parameters:
        `position` - The position of the divider, in pixels. A negative value means that the position is not being forced.
      Since:
        4.0.7