Gtk.Container.prototype.propagate_draw
function propagate_draw(child:Gtk.Widget, cr:cairo.Context):void { // Gjs wrapper for gtk_container_propagate_draw() }
When a container receives a call to the draw function, it must send synthetic Gtk.draw calls to all children that don't have their own #GdkWindows. This function provides a convenient way of doing this. A container, when it receives a call to its Gtk.draw function, calls Gtk.Container.prototype.propagate_draw once for each child, passing in the cr the container received.
Gtk.Container.prototype.propagate_draw takes care of translating the origin of cr, and deciding whether the draw needs to be sent to the child. It is a convenient and optimized way of getting the same effect as calling Gtk.draw on the child directly.
In most cases, a container can simply either inherit the Gtk.draw implementation from Gtk.Container, or do some drawing and then chain to the ::draw implementation from Gtk.Container.
- child
a child of container
- cr
Cairo context as passed to the container. If you want to use cr in container's draw function, consider using cairo_save() and cairo_restore() before calling this function.