~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to Tixish/BrowseEntry.pm

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
package Tk::BrowseEntry;
9
9
 
10
10
use vars qw($VERSION);
11
 
$VERSION = sprintf '4.%03d', q$Revision: #13 $ =~ /\D(\d+)\s*$/;
 
11
$VERSION = '4.014'; # was: sprintf '4.%03d', q$Revision: #13 $ =~ /\D(\d+)\s*$/;
12
12
 
13
13
use Tk qw(Ev);
14
14
use Carp;
26
26
sub Populate {
27
27
    my ($w, $args) = @_;
28
28
 
 
29
    my %labelArgs;
 
30
    while(my($k,$v) = each %$args) {
 
31
        $labelArgs{$k} = $v;
 
32
        delete $args->{$k};
 
33
    }
 
34
 
29
35
    $w->Tk::Frame::Populate($args);
30
36
 
 
37
    while(my($k,$v) = each %labelArgs) {
 
38
        $args->{$k} = $v;
 
39
    }
 
40
 
31
41
    # entry widget and arrow button
32
42
    my $lpack = delete $args->{-labelPack};
33
43
    if (not defined $lpack) {
267
277
        if (defined $current_sel) {
268
278
            my $i = 0;
269
279
            foreach my $str ($s->get(0, "end")) {
 
280
                local $^W = 0; # in case of undefined strings
270
281
                if ($str eq $current_sel) {
271
282
                    $s->selectionClear(0, "end");
272
283
                    $s->selectionSet($i);
376
387
   my $old = $$var;
377
388
   foreach my $val (@$choices)
378
389
    {
 
390
     local $^W = 0; # in case of undefined values
379
391
     $w->insert( 'end', $val);
380
392
     $hash{$val} = 1;
381
393
    }
382
394
   $old = $choices->[0]
383
 
    if defined $old && not exists $hash{$old} && defined $choices->[0];
 
395
    if defined $old && !exists $hash{$old} && defined $choices->[0];
384
396
   $$var = $old;
385
397
  }
386
398
 else