Name
pcontext:SetShapeRenderer -- set shape renderer
Synopsis
pcontext:SetShapeRenderer([func[, userdata]])
Function
Sets callback function for context to use for rendering attributes of type #PANGO_ATTR_SHAPE.

The callback function will receive three to four arguments: The first argument will be a handle to a Cairo context, the second argument will be a Pango attribute of type shape and the third argument will be a boolean that indicates whether only the shape path should be appended to current path of the Cairo context and no filling/stroking should be done. If you specify the userdata parameter, it will be forwarded to the callback function as the fourth parameter.

To disable shape rendering, call this function without any arguments.

Note that you must make sure that the object you call this function on stays valid for as long as you need the shape renderer so make sure that you don't set it to Nil and make sure that the object isn't garbage-collected in any way. See the ShapeText.hws example that comes with Pangomonium for an example on how to make sure that the object you call this function on doesn't get garbage collected.

Inputs
func
optional: callback function for rendering attributes of type #PANGO_ATTR_SHAPE
userdata
optional: user data that will be passed to func

Show TOC