CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
[Tk] No selection with tagAdd

 



Mersenne
New User

Mar 25, 2009, 10:29 AM

Post #1 of 2 (763 views)
[Tk] No selection with tagAdd Can't Post

Hello !
I use Windows XP.
I downloaded ActivePerl and Tk yesterday.
It seems that in the following program, tagAdd has no effect :


Code
 
use Tk;
use strict;
use utf8;
use warnings;

my $mw = MainWindow->new;

my $hauteurEcran = $mw->screenheight();
my $largeurEcran = $mw->screenwidth();

$mw->configure(
-width => $largeurEcran,
-height => $hauteurEcran,
);


$mw->title("Test sélection");
$mw->geometry(sprintf("%d",$largeurEcran) . "x" . sprintf("%d", $hauteurEcran) . "+0+0");
$mw->raise();




my $zoneTexte = $mw->Scrolled('Text',
-scrollbars => 'se',
-wrap => 'word',
)->place(
-anchor => 'nw',
-width => $largeurEcran,
-relheight => 0.95,
-relx => 0.0,
-rely => 0.05,
);

$zoneTexte->insert('end', "abc");
$zoneTexte->tagAdd('sel', '1.0', 'end');

MainLoop;


Does anybody have an explanation ?
Thanks.


(This post was edited by Mersenne on Mar 25, 2009, 10:31 AM)


Mersenne
New User

Mar 30, 2009, 9:49 AM

Post #2 of 2 (735 views)
Re: [Mersenne] [Tk] No selection with tagAdd [In reply to] Can't Post

It suffices to give the focus :
$zoneTexte->focus();

Sorry...

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives