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

GI.Gtk.Objects.WidgetPaintable

Description

GtkWidgetPaintable is an implementation of the Paintable interface that allows displaying 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 invalidateSize signal whenever the size of the widget changes as well as for visual changes by emitting the invalidateContents signal whenever the widget changes.

You can of course use a GtkWidgetPaintable everywhere a Paintable is allowed, including using it on a Picture (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 the Picture:can-shrink 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

Overloaded methods

getWidget

widgetPaintableGetWidget Source #

Arguments

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

self: a WidgetPaintable

-> 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 Widget or Nothing

-> m WidgetPaintable

Returns: a new WidgetPaintable

Creates a new widget paintable observing the given widget.

setWidget

widgetPaintableSetWidget Source #

Arguments

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

self: a WidgetPaintable

-> Maybe b

widget: the widget to observe or Nothing

-> 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, IsWidget a) => a -> IO (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 ]