Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype WidgetPaintable = WidgetPaintable (ManagedPtr WidgetPaintable)
- class (GObject o, IsDescendantOf WidgetPaintable o) => IsWidgetPaintable o
- toWidgetPaintable :: (MonadIO m, IsWidgetPaintable o) => o -> m WidgetPaintable
- widgetPaintableGetWidget :: (HasCallStack, MonadIO m, IsWidgetPaintable a) => a -> m (Maybe Widget)
- widgetPaintableNew :: (HasCallStack, MonadIO m, IsWidget a) => Maybe a -> m WidgetPaintable
- widgetPaintableSetWidget :: (HasCallStack, MonadIO m, IsWidgetPaintable a, IsWidget b) => a -> Maybe b -> m ()
- clearWidgetPaintableWidget :: (MonadIO m, IsWidgetPaintable o) => o -> m ()
- constructWidgetPaintableWidget :: (IsWidgetPaintable o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getWidgetPaintableWidget :: (MonadIO m, IsWidgetPaintable o) => o -> m (Maybe Widget)
- setWidgetPaintableWidget :: (MonadIO m, IsWidgetPaintable o, IsWidget a) => o -> a -> m ()
Exported types
newtype WidgetPaintable Source #
Memory-managed wrapper type.
Instances
Eq WidgetPaintable Source # | |
Defined in GI.Gtk.Objects.WidgetPaintable (==) :: WidgetPaintable -> WidgetPaintable -> Bool # (/=) :: WidgetPaintable -> WidgetPaintable -> Bool # | |
GObject WidgetPaintable Source # | |
Defined in GI.Gtk.Objects.WidgetPaintable | |
ManagedPtrNewtype WidgetPaintable Source # | |
Defined in GI.Gtk.Objects.WidgetPaintable | |
TypedObject WidgetPaintable Source # | |
Defined in GI.Gtk.Objects.WidgetPaintable | |
HasParentTypes WidgetPaintable Source # | |
Defined in GI.Gtk.Objects.WidgetPaintable | |
IsGValue (Maybe WidgetPaintable) Source # | Convert |
Defined in GI.Gtk.Objects.WidgetPaintable gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe WidgetPaintable -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe WidgetPaintable) # | |
type ParentTypes WidgetPaintable Source # | |
Defined in GI.Gtk.Objects.WidgetPaintable |
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
(GObject o, IsDescendantOf WidgetPaintable o) => IsWidgetPaintable o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, computeConcreteSize, forceFloating, freezeNotify, getv, invalidateContents, invalidateSize, isFloating, notify, notifyByPspec, ref, refSink, runDispose, snapshot, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCurrentImage, getData, getFlags, getIntrinsicAspectRatio, getIntrinsicHeight, getIntrinsicWidth, getProperty, getQdata, getWidget.
Setters
getWidget
widgetPaintableGetWidget Source #
:: (HasCallStack, MonadIO m, IsWidgetPaintable a) | |
=> a |
|
-> m (Maybe Widget) | Returns: the observed widget. |
Returns the widget that is observed or Nothing
if none.
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> Maybe a |
|
-> m WidgetPaintable | Returns: a new |
Creates a new widget paintable observing the given widget.
setWidget
widgetPaintableSetWidget Source #
:: (HasCallStack, MonadIO m, IsWidgetPaintable a, IsWidget b) | |
=> a |
|
-> Maybe b |
|
-> 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 ]