Respected Monks

*I humbly ask for your Enlightenment please – I am quit confused on how to proceed and having spend all day today trying to no avail*

I have this bit of Tk code
use strict; use vars qw/@winbcp_info/; use Tk (); use Tk::TList; use Tk::HList; my $mw = Tk::MainWindow->new(); my $image = $mw->Getimage('folder'); #my $tlist = $mw->TList(-orient => 'vertical'); my $label = $mw->Label(-width=>15); my $hlist = $mw->HList( -itemtype => 'text', -separator => '/', -selectmode => 'single', -browsecmd => sub { my $file = shift; $label->configure(-text=> +$file); }); open (LST, "L:\\ceas\\Farringdon deployment\\Raj\\IED_IPB_TEST.CSV")|| +die "$^E : $!\n"; chomp (my @work_file=<LST>); for (@work_file) { my $data = {}; ($data->{business_unit}, $data->{group_name}, $data->{functions},) = split (/,/,$_); push (@winbcp_info, $data); } for my $text ( @winbcp_info ) { # $tlist->insert('end', -itemtype=>'imagetext', -image=>$image, -tex +t=>$text->{business_unit}); $hlist->add($text->{business_unit}, -text=>$text); }
And I have this bit of data
Dept Group Function IT, Projects, SAN/NAS, IT, Development, GUI, IT, Security, HR, Admin, West HR, Management, West Legal, Admin, FirmWide, Legal, Compliance,
How can I present this data in a Hierarchical folder presentation?

I have tried TList and HList as you see above but they did not work - The Tlist listed all the data in Hexadecimal format. While the HList failed to display anything.

Is there a way where I can present the data in Hierarchical format, similar to DirTree does? Moreover, how can I do this (with DirTree I can change Directory like this; $tk{dir_tree}->chdir( $dr{PATH} ); however I am not sure on how to do this with a list of hashes)?

This is one vital bit of Perl/Tk that I need urgently to know how its done Please.

Thanks In advance

Blackadder

In reply to Displaying a list of hashes in TK in a Hierarchical folder presentation by blackadder

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.