gi-gtk-3.0.37: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.Style

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
t'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

Exported types

newtype Style Source #

Memory-managed wrapper type.

Constructors

Style (ManagedPtr Style) 

Instances

Instances details
Eq Style Source # 
Instance details

Defined in GI.Gtk.Objects.Style

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

GObject Style Source # 
Instance details

Defined in GI.Gtk.Objects.Style

ManagedPtrNewtype Style Source # 
Instance details

Defined in GI.Gtk.Objects.Style

Methods

toManagedPtr :: Style -> ManagedPtr Style

TypedObject Style Source # 
Instance details

Defined in GI.Gtk.Objects.Style

Methods

glibType :: IO GType

HasParentTypes Style Source # 
Instance details

Defined in GI.Gtk.Objects.Style

IsGValue (Maybe Style) Source #

Convert Style to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.Style

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Style -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Style)

type ParentTypes Style Source # 
Instance details

Defined in GI.Gtk.Objects.Style

type ParentTypes Style = '[Object]

class (GObject o, IsDescendantOf Style o) => IsStyle o Source #

Type class for types which can be safely cast to Style, for instance with toStyle.

Instances

Instances details
(GObject o, IsDescendantOf Style o) => IsStyle o Source # 
Instance details

Defined in GI.Gtk.Objects.Style

toStyle :: (MonadIO m, IsStyle o) => o -> m Style Source #

Cast to Style, for types for which this is known to be safe. For general casts, use castTo.

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

styleCopy Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a) 
=> a

style: a Style

-> m Style

Returns: a copy of style

Deprecated: (Since version 3.0)Use StyleContext instead

Creates a copy of the passed in Style object.

detach

styleDetach Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a) 
=> a

style: a Style

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

style: a Style

-> GType

widgetType: the GType of a descendant of Widget

-> Text

propertyName: the name of the style property to get

-> m GValue 

Queries the value of a style property corresponding to a widget class is in the given style.

Since: 2.16

hasContext

styleHasContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a) 
=> a

style: a Style

-> m Bool

Returns: True if style has a StyleContext

Returns whether style has an associated StyleContext.

Since: 3.0

lookupColor

styleLookupColor Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a) 
=> a

style: a Style

-> Text

colorName: the name of the logical color to look up

-> m (Bool, Color)

Returns: True if the mapping was found.

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

styleLookupIconSet Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a) 
=> a

style: a Style

-> Text

stockId: an icon name

-> m IconSet

Returns: icon set of stockId

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

styleNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Style

Returns: a new Style.

Deprecated: (Since version 3.0)Use StyleContext

Creates a new Style.

renderIcon

styleRenderIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a, IsWidget b) 
=> a

style: a Style

-> IconSource

source: the IconSource specifying the icon to render

-> TextDirection

direction: a text direction

-> StateType

state: a state

-> Int32

size: the size to render the icon at (tIconSize). A size of (GtkIconSize)-1 means render at the size of the source and don’t scale.

-> Maybe b

widget: the widget

-> Maybe Text

detail: a style detail

-> m Pixbuf

Returns: a newly-created Pixbuf containing the rendered icon

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

styleSetBackground Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyle a, IsWindow b) 
=> a

style: a Style

-> b

window: a Window

-> StateType

stateType: a state

-> 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, MonadIO m, IsStyleContext a) => a -> m (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 :: MonadIO m => StyleRealizeCallback -> m (GClosure C_StyleRealizeCallback) Source #

Wrap the callback into a GClosure.

mk_StyleRealizeCallback :: C_StyleRealizeCallback -> IO (FunPtr C_StyleRealizeCallback) Source #

Generate a function pointer callable from C code, from a C_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

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 :: MonadIO m => StyleUnrealizeCallback -> m (GClosure C_StyleUnrealizeCallback) Source #

Wrap the callback into a GClosure.

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