First of all, it is difficult to debug what you posted since the code you posted has only 1 row in the HList widget.
Second, I modified it a bit to add a second duplicate row, removed the $main references and it works fine for me.

#!/usr/bin/perl -w use strict vars; use Tk; require Tk::HList; my $helix_lf = MainWindow->new(); my $helix_result_list=$helix_lf->Scrolled('HList', -scrollbars => 'oe', -width => 50, -height => 20, -header => 1, -columns => 5, -selectbackground=>'green', -command =>\&change_hlist_bg )->pack(-expand=>1, -fill=>'both', -padx=>2, -pady=>2); $helix_result_list->headerCreate( 0, -text => 'Chain'); $helix_result_list->headerCreate( 1, -text => 'Ssqno'); $helix_result_list->headerCreate( 2, -text => 'Esqno'); $helix_result_list->headerCreate( 3, -text => 'Class'); $helix_result_list->headerCreate( 4, -text => 'Sequence'); $helix_result_list->add(helix_result_count); $helix_result_list->add(helix_result_count1); $helix_result_list->itemCreate(helix_result_count,0,-text=> "one"); $helix_result_list->itemCreate(helix_result_count,1,-text=> "two"); $helix_result_list->itemCreate(helix_result_count,2,-text=> "three"); $helix_result_list->itemCreate(helix_result_count,3,-text=> "four"); $helix_result_list->itemCreate(helix_result_count,4,-text=>"five"); $helix_result_list->itemCreate(helix_result_count1,0,-text=> "one"); $helix_result_list->itemCreate(helix_result_count1,1,-text=> "two"); $helix_result_list->itemCreate(helix_result_count1,2,-text=> "three"); $helix_result_list->itemCreate(helix_result_count1,3,-text=> "four"); $helix_result_list->itemCreate(helix_result_count1,4,-text=>"five"); MainLoop;

Hope this helps,
davidj

update:The reason I removed the references to "main" package is because I was getting the following error:
D:\PerlProjects\tests\HList.pl Entry "" not found at C:/Perl/site/lib/Tk.pm line 228.
Now, you may need the $main references. I couldn't tell by the code you posted. However, try taking them out and see if it works for you.

In reply to Re: Problem with Hlist in Perl/TK by davidj
in thread Problem with Hlist in Perl/TK by sandeep.ses

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.