======== Table Of Contents ========
Paved::canvasAdaptor - transforms an existing canvas widget in a Paved-canvas
package require Paved::canvas
Paved::canvasAdaptor pathName ?options?
Paved::canvasAdaptor transforms an existing canvas in a a Paved-canvas.
Actually Paved::canvas is built upon Paved::canvasAdaptor, that is, the latter is the real widget, whilst Paved::canvas simply creates a canvas, then transforms it using Paved::canvasAdaptor.
Once a canvas has been transformed in a Paved-Canvas, you can use all its options/sub-commands/bindings as if it were an original Paved::canvas.
# creates a standard canvas canvas .c -bg red pack .c -expand true -fill both package require Paved::canvas # suppose xyz.gif is in current directory # get the original canvas .c and transform it in a paved-canvas Paved::canvasAdaptor .c -tile xyz.gif
Currently, if an error occurs during the canvas wrapping (example: using a wrong option), then the original canvas is destroyed !
For this reason, referring to the previous example, if file "xyz.gif" could not exist, it is suggested to replace the command:
Paved::canvasAdaptor $c -tile xyz.gif
with
Paved::canvasAdaptor $c $c configure -tile xyz.gif
In this latter case, the original canvas is transformed in a paved-canvas (though "$c configure -tile .." fails).
In the former case, if "xyz.gif" does not exist, the whole command fails, and the original canvas is lost!