| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gtk.Objects.Style
Contents
Description
A Style object encapsulates the information that provides the look and
feel for a widget.
In GTK+ 3.0, GtkStyle has been deprecated and replaced by 'GI.Gtk.Objects.StyleContext.StyleContext'.
Each Widget has an associated Style object that is used when
rendering that widget. Also, a Style holds information for the five
possible widget states though not every widget supports all five
states; see StateType.
Usually the Style for a widget is the same as the default style that
is set by GTK+ and modified the theme engine.
Usually applications should not need to use or modify the Style of
their widgets.
Synopsis
- newtype Style = Style (ManagedPtr Style)
- class GObject o => IsStyle o
- toStyle :: (MonadIO m, IsStyle o) => o -> m Style
- noStyle :: Maybe Style
- styleApplyDefaultBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> Context -> b -> StateType -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- styleCopy :: (HasCallStack, MonadIO m, IsStyle a) => a -> m Style
- styleDetach :: (HasCallStack, MonadIO m, IsStyle a) => a -> m ()
- styleGetStyleProperty :: (HasCallStack, MonadIO m, IsStyle a) => a -> GType -> Text -> m GValue
- styleHasContext :: (HasCallStack, MonadIO m, IsStyle a) => a -> m Bool
- styleLookupColor :: (HasCallStack, MonadIO m, IsStyle a) => a -> Text -> m (Bool, Color)
- styleLookupIconSet :: (HasCallStack, MonadIO m, IsStyle a) => a -> Text -> m IconSet
- styleNew :: (HasCallStack, MonadIO m) => m Style
- styleRenderIcon :: (HasCallStack, MonadIO m, IsStyle a, IsWidget b) => a -> IconSource -> TextDirection -> StateType -> Int32 -> Maybe b -> Maybe Text -> m Pixbuf
- styleSetBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> b -> StateType -> m ()
- constructStyleContext :: (IsStyle o, IsStyleContext a) => a -> IO (GValueConstruct o)
- getStyleContext :: (MonadIO m, IsStyle o) => o -> m (Maybe StyleContext)
- type C_StyleRealizeCallback = Ptr () -> Ptr () -> IO ()
- type StyleRealizeCallback = IO ()
- afterStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId
- genClosure_StyleRealize :: StyleRealizeCallback -> IO Closure
- mk_StyleRealizeCallback :: C_StyleRealizeCallback -> IO (FunPtr C_StyleRealizeCallback)
- noStyleRealizeCallback :: Maybe StyleRealizeCallback
- onStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId
- wrap_StyleRealizeCallback :: StyleRealizeCallback -> C_StyleRealizeCallback
- type C_StyleUnrealizeCallback = Ptr () -> Ptr () -> IO ()
- type StyleUnrealizeCallback = IO ()
- afterStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId
- genClosure_StyleUnrealize :: StyleUnrealizeCallback -> IO Closure
- mk_StyleUnrealizeCallback :: C_StyleUnrealizeCallback -> IO (FunPtr C_StyleUnrealizeCallback)
- noStyleUnrealizeCallback :: Maybe StyleUnrealizeCallback
- onStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId
- wrap_StyleUnrealizeCallback :: StyleUnrealizeCallback -> C_StyleUnrealizeCallback
Exported types
Memory-managed wrapper type.
Constructors
| Style (ManagedPtr Style) |
Instances
| GObject Style Source # | |
Defined in GI.Gtk.Objects.Style Methods gobjectType :: Style -> IO GType # | |
| IsObject Style Source # | |
Defined in GI.Gtk.Objects.Style | |
| IsStyle Style Source # | |
Defined in GI.Gtk.Objects.Style | |
class GObject o => IsStyle o Source #
Instances
| (GObject a, (UnknownAncestorError Style a :: Constraint)) => IsStyle a Source # | |
Defined in GI.Gtk.Objects.Style | |
| IsStyle Style Source # | |
Defined in GI.Gtk.Objects.Style | |
Methods
applyDefaultBackground
styleApplyDefaultBackground :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) => a -> Context -> b -> StateType -> Int32 -> Int32 -> Int32 -> Int32 -> m () Source #
Deprecated: (Since version 3.0)Use StyleContext instead
No description available in the introspection data.
copy
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> m Style | Returns: a copy of |
Deprecated: (Since version 3.0)Use StyleContext instead
Creates a copy of the passed in Style object.
detach
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> m () |
Deprecated: (Since version 3.0)Use StyleContext instead
Detaches a style from a window. If the style is not attached
to any windows anymore, it is unrealized. See gtk_style_attach().
getStyleProperty
styleGetStyleProperty Source #
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> GType | |
| -> Text |
|
| -> m GValue |
Queries the value of a style property corresponding to a widget class is in the given style.
Since: 2.16
hasContext
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> m Bool | Returns: |
Returns whether style has an associated StyleContext.
Since: 3.0
lookupColor
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> Text |
|
| -> m (Bool, Color) | Returns: |
Deprecated: (Since version 3.0)Use styleContextLookupColor instead
Looks up colorName in the style’s logical color mappings,
filling in color and returning True if found, otherwise
returning False. Do not cache the found mapping, because
it depends on the Style and might change when a theme
switch occurs.
Since: 2.10
lookupIconSet
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a) | |
| => a |
|
| -> Text |
|
| -> m IconSet | Returns: icon set of |
Deprecated: (Since version 3.0)Use styleContextLookupIconSet instead
Looks up stockId in the icon factories associated with style
and the default icon factory, returning an icon set if found,
otherwise Nothing.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Style | Returns: a new |
Deprecated: (Since version 3.0)Use StyleContext
Creates a new Style.
renderIcon
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a, IsWidget b) | |
| => a |
|
| -> IconSource |
|
| -> TextDirection |
|
| -> StateType |
|
| -> Int32 |
|
| -> Maybe b |
|
| -> Maybe Text |
|
| -> m Pixbuf | Returns: a newly-created |
Deprecated: (Since version 3.0)Use renderIconPixbuf instead
Renders the icon specified by source at the given size
according to the given parameters and returns the result in a
pixbuf.
setBackground
Arguments
| :: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) | |
| => a |
|
| -> b |
|
| -> StateType |
|
| -> m () |
Deprecated: (Since version 3.0)Use styleContextSetBackground instead
Sets the background of window to the background color or pixmap
specified by style for the given state.
Properties
context
No description available in the introspection data.
constructStyleContext :: (IsStyle o, IsStyleContext a) => a -> IO (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “context” property. This is rarely needed directly, but it is used by new.
getStyleContext :: (MonadIO m, IsStyle o) => o -> m (Maybe StyleContext) Source #
Get the value of the “context” property.
When overloading is enabled, this is equivalent to
get style #context
Signals
realize
type C_StyleRealizeCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type StyleRealizeCallback = IO () Source #
Emitted when the style has been initialized for a particular visual. Connecting to this signal is probably seldom useful since most of the time applications and widgets only deal with styles that have been already realized.
Since: 2.4
afterStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId Source #
Connect a signal handler for the “realize” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after style #realize callback
genClosure_StyleRealize :: StyleRealizeCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_StyleRealizeCallback :: C_StyleRealizeCallback -> IO (FunPtr C_StyleRealizeCallback) Source #
Generate a function pointer callable from C code, from a C_StyleRealizeCallback.
noStyleRealizeCallback :: Maybe StyleRealizeCallback Source #
A convenience synonym for .Nothing :: Maybe StyleRealizeCallback
onStyleRealize :: (IsStyle a, MonadIO m) => a -> StyleRealizeCallback -> m SignalHandlerId Source #
Connect a signal handler for the “realize” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on style #realize callback
wrap_StyleRealizeCallback :: StyleRealizeCallback -> C_StyleRealizeCallback Source #
Wrap a StyleRealizeCallback into a C_StyleRealizeCallback.
unrealize
type C_StyleUnrealizeCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type StyleUnrealizeCallback = IO () Source #
Emitted when the aspects of the style specific to a particular visual
is being cleaned up. A connection to this signal can be useful
if a widget wants to cache objects as object data on Style.
This signal provides a convenient place to free such cached objects.
Since: 2.4
afterStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId Source #
Connect a signal handler for the “unrealize” signal, to be run after the default handler.
When overloading is enabled, this is equivalent to
after style #unrealize callback
genClosure_StyleUnrealize :: StyleUnrealizeCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_StyleUnrealizeCallback :: C_StyleUnrealizeCallback -> IO (FunPtr C_StyleUnrealizeCallback) Source #
Generate a function pointer callable from C code, from a C_StyleUnrealizeCallback.
noStyleUnrealizeCallback :: Maybe StyleUnrealizeCallback Source #
A convenience synonym for .Nothing :: Maybe StyleUnrealizeCallback
onStyleUnrealize :: (IsStyle a, MonadIO m) => a -> StyleUnrealizeCallback -> m SignalHandlerId Source #
Connect a signal handler for the “unrealize” signal, to be run before the default handler.
When overloading is enabled, this is equivalent to
on style #unrealize callback