1.215 <GtkWidgetPaintable>

Class: <GtkWidgetPaintable>

It derives from <GObject>.

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:invalidate-size signal whenever the size of the widget changes as well as for visual changes by emitting the paintable:invalidate-contents 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 picture:set-paintable. The paintable will take care of recursion when this happens. If you do this however, ensure that the picture:can-shrink property is set to #t or you might end up with an infinitely growing widget.

Properties

Property: widget-paintable:widget self

The observed widget or #f if none.

Its value is a <GtkWidget>, or #f.

Set it with (set! (widget-paintable:widget self) value).

Procedures

Method: widget-paintable:get-widget self ⇒ %return
Method: get-widget self ⇒ %return

Returns the widget that is observed or #f if none.

self

Passed: a <GtkWidgetPaintable>.

a <GtkWidgetPaintable>

%return

Returned: a <GtkWidget>, or #f.

the observed widget.

Procedure: widget-paintable:new [widget] ⇒ %return

Creates a new widget paintable observing the given widget.

widget

Passed, or left out: a <GtkWidget>, or #f.

a <GtkWidget>

%return

Returned: a <GtkWidgetPaintable>.

a new <GtkWidgetPaintable>

Method: widget-paintable:set-widget self [widget]
Method: set-widget self [widget]

Sets the widget that should be observed.

self

Passed: a <GtkWidgetPaintable>.

a <GtkWidgetPaintable>

widget

Passed, or left out: a <GtkWidget>, or #f.

the widget to observe