WidgetPaintableProtocol

public protocol WidgetPaintableProtocol : ObjectProtocol, PaintableProtocol

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 [signalGdk.Paintable::invalidate-size] signal whenever the size of the widget changes as well as for visual changes by emitting the [signalGdk.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 gtk_picture_set_paintable(). The paintable will take care of recursion when this happens. If you do this however, ensure that the [propertyGtk.Picture:can-shrink] property is set to true or you might end up with an infinitely growing widget.

The WidgetPaintableProtocol protocol exposes the methods and properties of an underlying GtkWidgetPaintable instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see WidgetPaintable. Alternatively, use WidgetPaintableRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkWidgetPaintable instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • widget_paintable_ptr Default implementation

    Typed pointer to the underlying GtkWidgetPaintable instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkWidgetPaintable instance.

    Declaration

    Swift

    var widget_paintable_ptr: UnsafeMutablePointer<GtkWidgetPaintable>! { get }
  • Required Initialiser for types conforming to WidgetPaintableProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

WidgetPaintable Class

  • Bind a WidgetPaintablePropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: WidgetPaintablePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a WidgetPaintable property

    Declaration

    Swift

    @inlinable
    func get(property: WidgetPaintablePropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a WidgetPaintable property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: WidgetPaintablePropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

WidgetPaintable Class: WidgetPaintableProtocol extension (methods and fields)