Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I would like to have two canvasses side by side. It is easy to do that, but do you see the thin grey line between those two ? How do I get rid of it, or how do I change its color ?

#!/usr/bin/perl -w use strict; use Tk; my $mw = 'MainWindow'->new(); my $cv0 = $mw->Canvas( qw! -background red ! ) ->pack( qw! -fill both -expand 1 ! ); my $cv1 = $mw->Canvas( qw! -background blue ! ) ->pack( qw! -fill both -expand 1 ! ); MainLoop();

Any ideas ?

Thanks,

Philippe

2006-10-25 Retitled by planetscape, as per Monastery guidelines

( keep:3 edit:13 reap:0 )

Original title: 'PerlTk: Canvas within canvas question'

Replies are listed 'Best First'.
Re: PerlTk: Canvas next to another canvas
by Samy_rio (Vicar) on Oct 25, 2006 at 11:05 UTC

    Hi, try this,

    #!/usr/bin/perl -w use strict; use Tk; my $mw = 'MainWindow'->new(); #Remove the Borders my $cv0 = $mw->Canvas( qw! -background red -highlightthickness 0! ) ->pack( qw! -fill both -expand 1 ! ); my $cv1 = $mw->Canvas( qw! -background blue -highlightthickness 0! ) ->pack( qw! -fill both -expand 1 ! ); #Change the color of the Borders my $cv0 = $mw->Canvas( qw! -background red -highlightbackground cyan! + ) ->pack( qw! -fill both -expand 1 ! ); my $cv1 = $mw->Canvas( qw! -background blue -highlightbackground oran +ge! ) ->pack( qw! -fill both -expand 1 ! ); MainLoop();

    Regards,
    Velusamy R.


    eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

Re: PerlTk: Canvas next to another canvas
by vkon (Curate) on Oct 25, 2006 at 11:34 UTC
      -borderwidth 0

      For some widgets, yes. However, Canvas defaults to 0 for -borderwidth/-bd so that isn't the problem here. It's the highlightthickness as Samy_rio posted.

      Rob
        you're right