Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tk::SMListbox segfault on nonsensical resource file

6 views
Skip to first unread message

Mumia W.

unread,
Dec 4, 2009, 9:04:02 AM12/4/09
to
I've discovered that Tk::SMListbox segfaults if CMListbox is given a
color style that doesn't make sense. This is with Perl 5.10.0 and
perl-tk 804.028 and Tk::SMListbox 1.11. Please see the following program:

#!/usr/bin/perl
use strict;
use warnings;
use Tk;
use Tk::SMListbox;
use File::Slurp qw/read_file write_file/;
use File::Spec;

my $resfile = File::Spec->tmpdir().'/resfile.res';
write_file($resfile, <DATA>);

my $mw = MainWindow->new;
$mw->optionReadfile($resfile);

my $lbox = $mw->Scrolled('SMListbox',
-scrollbars => 'se',
-width => 480,
-height => 12,
-borderwidth => 1,
-columns => [
[ -text => 'Month', -width => 14 ],
[ -text => 'Sales', -width => 8 ],
[ -text => 'Contact', -width => 22 ],
],
);

$lbox->pack();
$mw->after(4000, sub { exit });

$lbox->insert('end', [January => 380114, 'jo...@example.com']);
$lbox->insert('end', [February => 322691, 'jo...@example.com']);
$lbox->insert('end', [March => 363277, 'bl...@example.com']);

MainLoop;


__DATA__
*CListbox.foreground: Arial 10 bold
__END__

The above program produces a segmentation fault on my system (Debian 5.0
i386).


Steve C

unread,
Dec 4, 2009, 2:24:23 PM12/4/09
to


SMListbox just adds sort controls to an MListbox. Does your code
segfault if you use MListbox instead?

Mumia W.

unread,
Dec 5, 2009, 3:54:50 AM12/5/09
to

I don't have Tk::MListbox installed.

0 new messages