10.8. How do I get the size of a Canvas? After a re-size?

    $canvas->cget(-width);
simply returns the size of the canvas when it was created, whereas
    $canvas->Width;
will get the answer even after a re-size. Substitute [Hh]eight for [Ww]idth in the above if that is what you want.

Nick Ing-Simmons points out that if you want to have your Canvas be able to grow to arbitrarily large sizes be sure to specify the -expand or -fill options when you ->pack the Canvas.


Previous | Return to table of contents | Next