Well you don't show any code, but here is something to play with. Tab around the widgets, or force focus to a canvas. Otherwise, show a minimal working code example, and say what you want it to do.
#!/usr/bin/perl use strict; use Tk; use Tk::Pane; my $mw = MainWindow->new; $mw->geometry('400x250'); my $mwf = $mw->Scrolled('Pane', -scrollbars=>'osoe', -sticky=>'nwse', )->pack(-expand=>1, -fill=>'both'); my $f1 = $mwf->Frame()->pack(); my $f2 = $mwf->Frame()->pack(); my %canv; for (0..4){ $canv{$_}{'obj'} = $f1->Scrolled('Canvas', -height => 100, -width => 100, -bg =>'white', -scrollbars => 'osoe', -scrollregion => [ 0, 0, 500, 500 ], )->pack(-side =>'left' ,-padx=>10,-pady=>10); $canv{$_}{'obj'}->createText(50,50, -text => $_, -anchor => 'center', ); my $num = $_; $canv{$num}{'obj'}->CanvasBind( '<FocusOut>' => sub{ $canv{$num}{'obj'}->configure(-bg=>'lightyellow'); } ); $canv{$num}{'obj'}->CanvasBind( '<FocusIn>' => sub{ $canv{$num}{'obj'}->configure(-bg=>'lightgreen'); } ); } for (5..9){ $canv{$_}{'obj'} = $f2->Scrolled('Canvas', -height => 100, -width => 100, -bg =>'white', -scrollbars => 'osoe', -scrollregion => [ 0, 0, 500, 500 ], )->pack(-side =>'left', -padx=>10,-pady=>10 ); $canv{$_}{'obj'}->createText(50,50, -text => $_, -anchor => 'center', ); my $num = $_; $canv{$num}{'obj'}->CanvasBind( '<FocusOut>' => sub{ $canv{$num}{'obj'}->configure(-bg=>'lightyellow'); } ); $canv{$num}{'obj'}->CanvasBind( '<FocusIn>' => sub{ $canv{$num}{'obj'}->configure(-bg=>'lightgreen'); } ); } my $button = $mw->Button(-text=>'Focus 1', -command => sub{ $canv{1}{'obj'}->focusForce; $canv{1}{'obj'}->configure(-bg=>'blue'); })->pack(); MainLoop();

I'm not really a human, but I play one on earth Remember How Lucky You Are

In reply to Re^2: canvas unselect by zentara
in thread canvas unselect 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.