On 12/04/2009 01:24 PM, Steve C wrote:
> Mumia W. wrote:
>> 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).
>>
>>
>
>
> SMListbox just adds sort controls to an MListbox. Does your code
> segfault if you use MListbox instead?
I don't have Tk::MListbox installed.