Widget.connectDraw

Connect to Draw signal.

This signal is emitted when a widget is supposed to render itself. The widget's top left corner must be painted at the origin of the passed in context and be sized to the values returned by gtk.widget.Widget.getAllocatedWidth and gtk.widget.Widget.getAllocatedHeight.

Signal handlers connected to this signal can modify the cairo context passed as cr in any way they like and don't need to restore it. The signal emission takes care of calling cairo.context.Context.save before and cairo.context.Context.restore after invoking the handler.

The signal handler will get a cr with a clip region already set to the widget's dirty region, i.e. to the area that needs repainting. Complicated widgets that want to avoid redrawing themselves completely can get the full extents of the clip region with gdk.global.cairoGetClipRectangle, or they can get a finer-grained representation of the dirty region with cairo.context.Context.copyClipRectangleList.

class Widget
gulong
connectDraw
(
T
)
(,
Flag!"After" after = No.After
)
if (
isCallable!T &&
is(ReturnType!T == bool)
&&
(
Parameters!T.length < 1 ||
(
ParameterStorageClassTuple!T[0] == ParameterStorageClass.none &&
is(Parameters!T[0] == cairo.context.Context)
)
)
&&
(
Parameters!T.length < 2 ||
(
ParameterStorageClassTuple!T[1] == ParameterStorageClass.none &&
is(Parameters!T[1] : gtk.widget.Widget)
)
)
&&
Parameters!T.length < 3
)

Parameters

callback T

signal callback delegate or function to connect

bool callback(cairo.context.Context cr, gtk.widget.Widget widget)

cr the cairo context to draw to (optional)

widget the instance the signal is connected to (optional)

Returns true to stop other handlers from being invoked for the event. false to propagate the event further.

after Flag!"After"

Yes.After to execute callback after default handler, No.After to execute before (default)

Return Value

Type: gulong

Signal ID