Thread [Tk::HList] Selektion entfernen (2 answers)
Opened by pktm at 2011-03-12 21:46

pktm
 2011-03-12 21:46
#146446 #146446
User since
2003-08-07
2921 Artikel
BenutzerIn
[Homepage]
user image
Hallo!

Wie kann ich die Selektion bei einer CPAN:Tk::HList gänzlich wegmachen?
Wenn ich untenstehenden Code nach der Dokumentation ausführe, bleibt dennoch ein Rahmen um das Element erhalten, dass ich zuletzt ausgewählt hatte.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!perl

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

my $mw = Tk::MainWindow->new();

my $zahl = 42;
my $hlist = $mw->HList(
    -width => 50,
)->pack(-fill => 'both', -expand => 1);

$mw->Button(
    -text => 'deselect',
    -command => sub{
        $hlist->selection('clear');
        return 1;
    },
)->pack(-fill => 'x',);

foreach( (qw(1 2 dkhj dfhgf dfskh sd)) ) {

    my $l = $hlist->addchild('');
    $hlist->itemCreate($l, 0, -itemtype => 'text', -text => $_);

}

$mw->MainLoop();


Grüße, pktm
http://www.intergastro-service.de (mein erstes CMS :) )

View full thread [Tk::HList] Selektion entfernen