Skip to content

Commit

Permalink
import Tk 800.025 from CPAN
Browse files Browse the repository at this point in the history
git-cpan-module:   Tk
git-cpan-version:  800.025
git-cpan-authorid: NI-S
git-cpan-file:     authors/id/N/NI/NI-S/Tk800.025.tar.gz
  • Loading branch information
Nick Ing-Simmons authored and eserte committed May 29, 2010
1 parent 9e207a8 commit 6ecaa13
Show file tree
Hide file tree
Showing 1,221 changed files with 121,487 additions and 290,869 deletions.
57 changes: 57 additions & 0 deletions BUGS
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
BUGS

- $w->cget(-cursor) returns a wrong value if the -cursor was
constructed with an anonymous array. Workaround: use the Tcl notation, e.g.
-cursor => '{@/path/to/your/cursor.xbm} red blue'

- sporadic core dumps on the end of bbbike with the following backtrace:
#0 0x283f5594 in Tk_CanvasEventuallyRedraw ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Canvas/Canvas.so
#1 0x284010a5 in ImageChangedProc ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Canvas/Canvas.so
#2 0x2825e532 in DeleteImage ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Tk.so
#3 0x2825e5cb in TkDeleteAllImages ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Tk.so
#4 0x2827f0bd in Tk_DestroyWindow ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Tk.so
#5 0x2824dbc5 in Tk_DestroyCmd ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Tk.so
#6 0x2823356f in Call_Tk ()
from /usr/perl5.8.0/lib/site_perl/5.8.0/i386-freebsd-64int/auto/Tk/Tk.so
...

- missing documentation: wrapper[1], $w->property, ConfigChanged,
Tk::LabEntry (with advertised widgets etc.)

- The ButtonHack in Tk::BrowseEntry looks suspicious. Does it still
work if there's more than one BrowseEntry per Toplevel? Maybe
implement a better solution: there's a per-toplevel array or hash
which is populated by the references to all containing BrowseEntries.
The references are deleted OnDestroy of the BrowseEntry.

- Reported in Message-ID: <[email protected]>: The oneliners

perl -e 'use Tk; tkinit()->Button(-text => 'Exit', -command => sub {exit 1})->pack; MainLoop();'

and

perl -e 'require Tk; import Tk; tkinit()->Button(-text => 'Exit', -command => sub {exit 1})->pack; MainLoop();'

may cause segmentation faults or "Callback called exit" messages.
The best is to avoid exit() at all and use $mw->destroy.

- cygwin:
Expect 8 subtest failures:
* all TList related tests fail
* fileevent does not work

- Excess space in TopLevels (Message-ID:
<yP%[email protected]>): this may be
related to the well-known "slow raise" problem in conjunction with
some weird layoutRequest code in Tk::ProgressBar

- Tk builds do not work if the source directory path contains spaces.

Please report bugs to either the Perl/Tk Mailing list
<[email protected]> or the Perl/Tk Newsgroup <comp.lang.perl.tk>.
10 changes: 9 additions & 1 deletion Tk/Bitmap.pm → Bitmap/Bitmap.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
package Tk::Bitmap;
require Tk;
import Tk qw($XS_VERSION);
require Tk::Image;

use vars qw($VERSION);
$VERSION = '4.002'; # $Id: //depot/Tkutf8/Tk/Bitmap.pm#2 $
$VERSION = '3.010'; # $Id: //depot/Tk8/Bitmap/Bitmap.pm#10 $

use base qw(Tk::Image);

Construct Tk::Image 'Bitmap';

bootstrap Tk::Bitmap;

sub Tk_image { 'bitmap' }

1;
__END__
31 changes: 31 additions & 0 deletions Bitmap/Bitmap.xs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
*/

#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>

#include "tkGlue.def"

#include "pTk/tkPort.h"
#include "pTk/tkInt.h"
#include "pTk/tkVMacro.h"
#include "tkGlue.h"
#include "tkGlue.m"

DECLARE_VTABLES;


MODULE = Tk::Bitmap PACKAGE = Tk::Bitmap

PROTOTYPES: DISABLE


BOOT:
{
IMPORT_VTABLES;
Tk_CreateImageType(&tkBitmapImageType);
}
5 changes: 5 additions & 0 deletions Bitmap/Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


use Tk::MMutil;
Tk::MMutil::TkExtMakefile('dynamic_ptk' => 1);

6 changes: 3 additions & 3 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Copyright (c) 1995-2000 Nick Ing-Simmons. All rights reserved.
Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
This package is free software; you can redistribute it and/or
modify it under the same terms as Perl itself, with the exception
of the files in the pTk sub-directory which have separate terms
derived from those of the orignal Tk4.0 sources and/or Tix.
derived from those of the orignal Tk4.0 sources and/or Tix.

IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
Expand All @@ -17,7 +17,7 @@ IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.

See pTk/license.terms for details of this Tk license,
See pTk/license.terms for details of this Tk license,
and pTk/Tix.license for the Tix license.


2 changes: 1 addition & 1 deletion Canvas/Canvas.pm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package Tk::Canvas;
use vars qw($VERSION);
$VERSION = '4.004'; # $Id: //depot/Tkutf8/Canvas/Canvas.pm#4 $
$VERSION = '3.018'; # $Id: //depot/Tk8/Canvas/Canvas.pm#18 $

use Tk qw($XS_VERSION);

Expand Down
6 changes: 3 additions & 3 deletions Canvas/Canvas.xs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 1995-2000 Nick Ing-Simmons. All rights reserved.
Copyright (c) 1995-2003 Nick Ing-Simmons. All rights reserved.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
*/
Expand All @@ -12,9 +12,9 @@

#include "pTk/tkPort.h"
#include "pTk/tkInt.h"
#include "pTk/tkVMacro.h"
#include "tkGlue.h"
#include "tkGlue.m"
#include "pTk/tkVMacro.h"

DECLARE_VTABLES;

Expand All @@ -28,7 +28,7 @@ void
canvas(...)
CODE:
{
XSRETURN(XSTkCommand(cv,1,Tk_CanvasObjCmd,items,&ST(0)));
XSRETURN(XSTkCommand(cv,(Tcl_CmdProc *)Tk_CanvasObjCmd,items,&ST(0)));
}


Expand Down
60 changes: 31 additions & 29 deletions Canvas/canvtxt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ my $txt = text_image();

my $c = $mw->Scrolled('Canvas',-bg => 'white',
-width => 10*@{$txt->[0]},
-height => 10 * @$txt);
-height => 10 * @$txt,
-scrollbars => 'osow');
$c->pack(-expand => 1, -fill => 'both');

my @v = find_vertical($txt);
Expand All @@ -37,19 +38,19 @@ foreach my $line (@v,@h)
{
my @line = @$line;
$c->createLine(map(10*$_,splice(@line,0,4)),@line,-fill => 'black');
}
}

foreach my $box (@box)
{
my ($x1,$y1,$x2,$y2) = @$box;
my @s;
my @s;
for (my $y = $y1+1; $y < $y2; $y++)
{
my $l = '';
for (my $x = $x1+1; $x < $x2; $x++)
{
$l .= $txt->[$y][$x];
}
}
$l =~ s/^\s+//;
$l =~ s/\s+$//;
push(@s,$l) if length($l);
Expand All @@ -58,22 +59,22 @@ foreach my $box (@box)
-justify => 'center', -anchor => 'center');
}


$c->configure(-scrollregion => [$c->bbox('all')]);

$mw->update;

MainLoop;

sub make_varrows
{
{
my $txt = shift;
foreach my $line (@_)
{
{
my $f = 0;
my ($x1,$y1,$x2,$y2) = @$line;
die unless $x1 == $x2;
for my $y ($y1..$y2)
{
{
my $ch = $txt->[$y][$x1];
$f |= 1 if $ch eq '^';
$f |= 2 if $ch eq 'v';
Expand All @@ -83,15 +84,15 @@ sub make_varrows
}

sub make_harrows
{
{
my $txt = shift;
foreach my $line (@_)
{
{
my $f = 0;
my ($x1,$y1,$x2,$y2) = @$line;
die unless $y1 == $y2;
for my $x ($x1..$x2)
{
{
my $ch = $txt->[$y1][$x];
$f |= 1 if $ch eq '<';
$f |= 2 if $ch eq '>';
Expand All @@ -106,8 +107,8 @@ sub find_boxes
my %x;
my %y;
foreach my $i (0..@$v-1)
{
my $line = $v->[$i]; # x,y1,x,y2
{
my $line = $v->[$i]; # x,y1,x,y2
my $x = $line->[0];
my $y = $line->[1];
my $e = $line->[3];
Expand All @@ -116,8 +117,8 @@ sub find_boxes
push(@{$y{$key}},[$x,$i]);
}
foreach my $i (0..@$h-1)
{
my $line = $h->[$i]; # x1,y,x2,y
{
my $line = $h->[$i]; # x1,y,x2,y
my $x = $line->[0];
my $y = $line->[1];
my $e = $line->[2];
Expand All @@ -129,21 +130,21 @@ sub find_boxes
my @vd;
my @hd;
foreach my $xk (keys %x)
{
{
my ($x1,$x2) = split(/-/,$xk);
my $xp = $x{$xk};
my @junk;
LOOP:
while (@$xp)
{
{
my ($y1,$i1) = @{splice(@$xp,0,1)};
for my $xi (0..@$xp-1)
{
my ($y2,$i2) = @{$xp->[$xi]};
my $yk = "$y1-$y2";
if (exists $y{$yk})
{
my $yp = $y{$yk};
my $yp = $y{$yk};
my $yi = 0;
for my $yi (0..@$yp-1)
{
Expand All @@ -170,7 +171,7 @@ sub find_boxes
}
}
push(@junk,[$y1,$i1]);
}
}
if (@junk)
{
$x{$xk} = \@junk;
Expand All @@ -192,7 +193,7 @@ sub find_boxes
}

sub find_vertical
{
{
my $txt = shift;
my $h = @$txt;
my $w = @{$txt->[0]};
Expand All @@ -201,7 +202,7 @@ sub find_vertical
for (my $y = 0; $y < $h; $y++)
{
for (my $x = 0; $x < $w; $x++)
{
{
my $s = $live[$x];
my $c = $txt->[$y][$x];
if (defined $s)
Expand All @@ -227,7 +228,7 @@ sub find_vertical
{
my $s = $live[$x];
if (defined $s)
{
{
if ($e - $s > 0)
{
push(@vert,[$x,$s,$x,$e]);
Expand All @@ -238,7 +239,7 @@ sub find_vertical
}

sub find_horizontal
{
{
my $txt = shift;
my $h = @$txt;
my $w = @{$txt->[0]};
Expand All @@ -247,7 +248,7 @@ sub find_horizontal
for (my $x = 0; $x < $w; $x++)
{
for (my $y = 0; $y < $h; $y++)
{
{
my $c = $txt->[$y][$x];
my $s = $live[$y];
if (defined $s)
Expand All @@ -258,7 +259,7 @@ sub find_horizontal
if ($e - $s > 0)
{
push(@horz,[$s,$y,$e,$y]);
}
}
$live[$y] = undef;
}
}
Expand All @@ -273,7 +274,7 @@ sub find_horizontal
{
my $s = $live[$y];
if (defined $s)
{
{
if ($e - $s > 0)
{
push(@horz,[$s,$y,$e,$y]);
Expand All @@ -293,23 +294,24 @@ sub show_txt
}

sub text_image
{
{
my @txt;
my $max = 0;
while (<>)
{
next if m#^/#;
next if m#^/#;
s/\s+$//;
my $l = length($_);
$max = $l if $l > $max;
push(@txt,[split('',$_)]);
}
foreach (@txt)
{
{
if (@$_ < $max)
{
push(@$_,(' ') x ($max - @$_));
}
}
return \@txt;
}

Loading

0 comments on commit 6ecaa13

Please sign in to comment.