gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.General.Style

Contents

- Description
- Types
- Methods

Description

Customization of widgets.

Synopsis

- data Style
- class GObjectClass o => StyleClass o
- castToStyle :: GObjectClass obj => obj -> Style
- gTypeStyle :: GType
- toStyle :: StyleClass o => o -> Style
- styleGetForeground :: Style -> StateType -> IO Color
- styleGetBackground :: Style -> StateType -> IO Color
- styleGetLight :: Style -> StateType -> IO Color
- styleGetMiddle :: Style -> StateType -> IO Color
- styleGetDark :: Style -> StateType -> IO Color
- styleGetText :: Style -> StateType -> IO Color
- styleGetBase :: Style -> StateType -> IO Color
- styleGetAntiAliasing :: Style -> StateType -> IO Color

# Description

Styles are attached to widgets and determine how particular parts are drawn and with what color. Thus they are should be seen as mandatory when one implements a new custom widgets via `DrawingArea`. Although the parameterized drawing function don't have to be used, it is strongly advisable (and more robust) to make use of the predefined graphics contexts for the different states of a widget (retrieved by `widgetGetState`).

# Types

data Style Source #

#### Instances

Instances details

Eq Style Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: Style -> Style -> Bool Source # (/=) :: Style -> Style -> Bool Source #
Ord Style Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods compare :: Style -> Style -> Ordering Source # (<) :: Style -> Style -> Bool Source # (<=) :: Style -> Style -> Bool Source # (>) :: Style -> Style -> Bool Source # (>=) :: Style -> Style -> Bool Source # max :: Style -> Style -> Style Source # min :: Style -> Style -> Style Source #
GObjectClass Style Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: Style -> GObject Source # unsafeCastGObject :: GObject -> Style Source #
StyleClass Style Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => StyleClass o Source #

#### Instances

Instances details

StyleClass Style Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToStyle :: GObjectClass obj => obj -> Style Source #

gTypeStyle :: GType Source #

toStyle :: StyleClass o => o -> Style Source #

# Methods

styleGetForeground :: Style -> StateType -> IO Color Source #

Retrieve the the foreground color.

- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetBackground :: Style -> StateType -> IO Color Source #

Retrieve the background color.

- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetLight :: Style -> StateType -> IO Color Source #

Retrieve a light color.

- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetMiddle :: Style -> StateType -> IO Color Source #

Retrieve a middle color.

- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetDark :: Style -> StateType -> IO Color Source #

Retrieve a dark color.

- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetText :: Style -> StateType -> IO Color Source #

Retrieve the text color.

- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetBase :: Style -> StateType -> IO Color Source #

Retrieve the base color.

- The base color is the standard text background of a widget.
- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.

styleGetAntiAliasing :: Style -> StateType -> IO Color Source #

Retrieve the color for drawing anti-aliased text.

- The anti-aliasing color is the color which is used when the rendering of a character does not make it clear if a certain pixel should be set or not. This color is between the text and the base color.
- The parameter `state` determines for which widget state (one of `StateType`) the `Color` should be retrieved. Use `widgetGetState` to determine the current state of the widget.