Dear Monks
I have three data categories; Business Units, Groups and Functions. Each Business Unit has a number of Groups, and each Group has a number of Functions. This data is stored in a query called Hydra-data in MS Access database (sorry).
Here is an n Example of this data:
IT,Development,GUI
IT,Operations,Trading,BackOffice
IT,Eng,SAN
FID,FuturesMarket
FID,Trading,Secretaries
IED,Quants
IED,CashSales,USSales
IED,FarEast,Japan
IED,SaleDesk1,CashSales,PrimSales
IED,SaleDesk2,CashSales,UKSales
IPB,ClientSevices,International
So I started by looking at this bit of code
# c:/pel/bin
use strict;
use Tk ();
use Tk::TList;
my $mw = Tk::MainWindow->new();
my $image = $mw->Getimage('folder');
my $tlist = $mw->TList(-orient => 'vertical');
for my $text ( qw/IBD IED IPB IT IFO IIM ER LEGAL FID TRESUERY CORPSER
+V CORPSEC/ )
{
$tlist->insert('end',
-itemtype=>'imagetext',
-image=>$image,
-text=>$text);
}
$tlist->pack(-expand=>'yes', -fill=>'both');
Tk::MainLoop;
But this code doesn’t serve my need, because TK::TList is pointing at
/IBD IED IPB IT IFO IIM ER LEGAL FID TRESUERY CORPSERV CORPSEC/
Is there away where I can get Tk to represent this data in a directory like hierarchy structure, similar to Tk::DirTree. So I can have a display of folders representing the Business Units, then inside those folders another folders for Groups and then for functions?
Also, if I read the above data into a hash then can I use TList to do the job?
Thanks for your help
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.