Paved::canvasAdaptor - 1.1

transforms an existing canvas widget in a Paved::canvas

======== Table Of Contents ========

NAME

Paved::canvasAdaptor - transforms an existing canvas widget in a Paved-canvas

SYNOPSIS

package require Paved::canvas

Paved::canvasAdaptor pathName ?options?

INTRODUCTION

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.

EXAMPLE

    # 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

BUGS

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!

HISTORY