org.gnome.gtk

## Class Frame

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

- Direct Known Subclasses:
    AspectFrame

      public class Frame
      extends Bin

  A decorative border frame with an optional label. This is typically used to surround a group of widgets with a a visual hint grouping them together.

  These are frequently over-used and so using Frames is actually highly discouraged: in general Widgets already have sufficient decoration and adding extra horizontal and vertical lines distracts the user and actually makes it harder to distinguish the Widgets from one another. If you need to group widgets, do so with white space or use a technique like applying `SizeGroup`s to give a set of Widgets a consistent appearance.

  Note that the "label" can be a full Widget in its own right; if you use the methods which take a text string they will transparently create a Label for you containing that text and using it on the edge of the Frame.

  Since:
    4.0.3
  Author:
    Sebastian Mancke, Andrew Cowie, 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.QueryTooltip, Widget.ScrollEvent, Widget.SizeAllocate, Widget.UnmapEvent, Widget.VisibilityNotifyEvent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Frame(String label)` Construct a new Frame with a simple text label.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getLabel()` Returns the text from the frame's edge (assuming it's a Label Widget as is usual practise).
    `Widget` | `getLabelWidget()` Returns the Widget being used as the "label" of the Frame.
    `void` | `setLabel(String label)` Set the text label for the Frame (assuming you created it with a Label in the first place).
    `void` | `setLabelAlign(float xalign, float yalign)` Sets the alignment of the Frame's label.
    `void` | `setLabelWidget(Widget label)` Set a Widget to be the "label" for the Frame.
    `void` | `setShadowType(ShadowType type)` Set the ShadowType of the Frame, that will determine the appearance of the outline.

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

      `getChild`

    - ### 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, 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

    - #### Frame

          public Frame(String label)

      Construct a new Frame with a simple text label.
      Parameters:
        `label` - The desired label, or `null` if you don't want to use any label.

  - ### Method Detail

    - #### getLabel

          public String getLabel()

      Returns the text from the frame's edge (assuming it's a Label Widget as is usual practise).

    - #### getLabelWidget

          public Widget getLabelWidget()

      Returns the Widget being used as the "label" of the Frame.

    - #### setLabel

          public void setLabel(String label)

      Set the text label for the Frame (assuming you created it with a Label in the first place).

    - #### setLabelAlign

          public void setLabelAlign(float xalign,
                           float yalign)

      Sets the alignment of the Frame's label.
      Parameters:
        `xalign` - The position of the label along the top edge of the widget. A value of `0.0f` represents left alignment; `1.0f` represents right alignment. The default value is `0.0f`
        `yalign` - The vertical alignment of the label. A value of `0.0f` aligns under the frame; `1.0f` aligns above the frame. The default value is `0.5f`.
      Since:
        4.0.7

    - #### setLabelWidget

          public void setLabelWidget(Widget label)

      Set a Widget to be the "label" for the Frame.

    - #### setShadowType

          public void setShadowType(ShadowType type)

      Set the ShadowType of the Frame, that will determine the appearance of the outline. The default is `ETCHED_IN`.
      Since:
        4.0.7