gi-gtk-4.0.10: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.WidgetPaintable

Description

GtkWidgetPaintable is a GdkPaintable that displays the contents of a widget.

GtkWidgetPaintable will also take care of the widget not being in a state where it can be drawn (like when it isn't shown) and just draw nothing or where it does not have a size (like when it is hidden) and report no size in that case.

Of course, GtkWidgetPaintable allows you to monitor widgets for size changes by emitting the Paintable::invalidateSize signal whenever the size of the widget changes as well as for visual changes by emitting the Paintable::invalidateContents signal whenever the widget changes.

You can use a GtkWidgetPaintable everywhere a GdkPaintable is allowed, including using it on a GtkPicture (or one of its parents) that it was set on itself via pictureSetPaintable. The paintable will take care of recursion when this happens. If you do this however, ensure that the Picture:canShrink property is set to True or you might end up with an infinitely growing widget.

Synopsis

Exported types

class (GObject o, IsDescendantOf WidgetPaintable o) => IsWidgetPaintable o Source #

Type class for types which can be safely cast to WidgetPaintable, for instance with toWidgetPaintable.

Instances

Instances details
(GObject o, IsDescendantOf WidgetPaintable o) => IsWidgetPaintable o Source # 
Instance details

Defined in GI.Gtk.Objects.WidgetPaintable

toWidgetPaintable :: (MonadIO m, IsWidgetPaintable o) => o -> m WidgetPaintable Source #

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

Methods

getWidget

widgetPaintableGetWidget Source #

Arguments

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

self: a GtkWidgetPaintable

-> m (Maybe Widget)

Returns: the observed widget.

Returns the widget that is observed or Nothing if none.

new

widgetPaintableNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) 
=> Maybe a

widget: a GtkWidget

-> m WidgetPaintable

Returns: a new GtkWidgetPaintable

Creates a new widget paintable observing the given widget.

setWidget

widgetPaintableSetWidget Source #

Arguments

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

self: a GtkWidgetPaintable

-> Maybe b

widget: the widget to observe

-> m () 

Sets the widget that should be observed.

Properties

widget

The observed widget or Nothing if none.

clearWidgetPaintableWidget :: (MonadIO m, IsWidgetPaintable o) => o -> m () Source #

Set the value of the “widget” property to Nothing. When overloading is enabled, this is equivalent to

clear #widget

constructWidgetPaintableWidget :: (IsWidgetPaintable o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “widget” property. This is rarely needed directly, but it is used by new.

getWidgetPaintableWidget :: (MonadIO m, IsWidgetPaintable o) => o -> m (Maybe Widget) Source #

Get the value of the “widget” property. When overloading is enabled, this is equivalent to

get widgetPaintable #widget

setWidgetPaintableWidget :: (MonadIO m, IsWidgetPaintable o, IsWidget a) => o -> a -> m () Source #

Set the value of the “widget” property. When overloading is enabled, this is equivalent to

set widgetPaintable [ #widget := value ]