org.gnome.gtk

## Class ToggleButton

- 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.Button
              - - org.gnome.gtk.ToggleButton

- All Implemented Interfaces:
    Activatable
  Direct Known Subclasses:
    CheckButton

      public class ToggleButton
      extends Button

  A ToggleButton is a Button which retains its state.
  Since:
    4.0.3
  Author:
    Sebastian Mancke, Andrew Cowie

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `ToggleButton.Toggled` Signal indicating the Button has changed state.

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

      `Button.Clicked`

    - ### 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
    `ToggleButton()` Constructs a new ToggleButton
    `ToggleButton(String label)` Constructs a new ToggleButton with a label.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `connect(ToggleButton.Toggled handler)` Hook up a `ToggleButton.Toggled` signal handler.
    `boolean` | `getActive()` Returns the current state of the ToggleButton
    `void` | `setActive(boolean active)` Set the state of the ToggleButon.

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

      `connect, emitClicked, getAlignmentX, getAlignmentY, getImage, getLabel, getRelatedAction, getRelief, setAlignment, setFocusOnClick, setImage, setLabel, setRelatedAction, setRelief`

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

    - #### ToggleButton

          public ToggleButton()

      Constructs a new ToggleButton
      Since:
        4.0.3

    - #### ToggleButton

          public ToggleButton(String label)

      Constructs a new ToggleButton with a label.

      The label may contain underscores (`_`) to indicate the mnemonic for the Button.``

      Since:
        4.0.3

  - ### Method Detail

    - #### connect

          public void connect(ToggleButton.Toggled handler)

      Hook up a `ToggleButton.Toggled` signal handler.
      Since:
        4.0.3

    - #### getActive

          public boolean getActive()

      Returns the current state of the ToggleButton
      Returns:
        returns `true` if the ToggleButton is pressed, `false` otherwise.
      Since:
        4.0.3

    - #### setActive

          public void setActive(boolean active)

      Set the state of the ToggleButon.
      Parameters:
        `active` - The new state of the ToggleButton
      Since:
        4.0.3