Maybe you could use a frame?
#!/usr/bin/perl -w use strict; use Tk; use Tk::Canvas; my $width = 750; my $height = 750; my $x_max = $width; my $y_max = $height; my $x_min = 5; my $y_min = 5; my $top = MainWindow->new(); my $frame = $top->Frame(); my $can = $top->Canvas( -width => $width/2, -height=> $height ); sub clear{ $can->delete( 'all' ); } my $x = 0; my $y = 0; my $n = 0; my $start_x = 0; my $start_y = 0; $can->create ( 'line', $x_min, $y_min, $x_max, $y_max ); $can->create ( 'line', $x_min, $y_max, $x_max, $y_min ); $can->packAdjust( -side => 'left', -fill => 'both', -delay => 1 ); $frame->pack( -side => 'left', -fill => 'y', -expand => 'y', -anchor => 'w' ); my $can2 = $top->Canvas( -width => $width/2, -height=> $height ); $can2->packAdjust( -side => 'right', -fill => 'both', -delay => 1 ); $can2->create ( 'line', $x_min, $y_min, $x_max, $y_max ); $can2->create ( 'line', $x_min, $y_max, $x_max, $y_min ); MainLoop;

Plankton: 1% Evil, 99% Hot Gas.

In reply to Re: Perl Tk canvas in a canvas question by Plankton
in thread Perl Tk canvas in a canvas question by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.