Ok,..Please bear with me - maybe I ma not making myself clear..
For a start your code doesn't represent the data in Dirtree like display. Your code displays the data , although its in hierarchal manner, buts its more like a table.
Lets forget I have a C drive and instead lets assume I have a drive called 'London', inside this drive I created folders that I called IT, HR, Legal, IBD,...etc. Iside each of these folders I created my Groups and then my function units. Then I programmed a Tk::DirTree to point to this drive. So in my Tk window I should see a top level folder called 'London' this folder will show as an opened folder icon. Under it I should see 4 folders with a plus sign on them to indicate that there are other folder inside them. exactly like this code;
use strict;
use Tk 800.005;
use Tk::TList;
use Tk::DirTree;
use Tk::Frame;
use Tk::Scrollbar;
use Tk::Adjuster;
use vars qw/%tk %dr %im @users @groups $dnd_token/;
$tk{mw} = MainWindow->new(-background => 'white');
$tk{mw}->geometry('500x400');
$tk{left_frame} = $tk{mw}->Frame;
$tk{adjuster} = $tk{mw}->Adjuster(-widget=> $tk{left_frame}, -side=
+>'left');
$tk{right_frame} = $tk{mw}->Frame;
$tk{dir_tree} = $tk{left_frame}->Scrolled('DirTree',
-height=>'0',
-width=>'0',
-scrollbars=>'e', );
$tk{output_list} = $tk{right_frame}->Scrolled('TList',
-height=>'1',
-width=>'1',
-scrollbars=>'osoe',);
$tk{user_list} = $tk{right_frame}->Scrolled('TList',
-height=>'1',
-width=>'1',
-scrollbars=>'osoe',);
$tk{group_list} = $tk{right_frame}->Scrolled('TList',
-height=>'1',
-width=>'1',
-scrollbars=>'osoe',);
$tk{user_label} = $tk{right_frame}->Label(-text => "Source Machines"
+);
$tk{group_label} = $tk{right_frame}->Label(-text => "Applications");
$tk{output_label} = $tk{right_frame}->Label(-text => "WinBcp Hosts");
$tk{dir_tree}-> delete('all');
$tk{dir_tree}-> chdir ("c:\\");
$tk{left_frame}->pack(qw/-side left -fill y/);
$tk{adjuster}->pack(qw/-side left -fill y/);
$tk{right_frame}->pack(qw/-side right -fill both -expand 1/);
$tk{dir_tree} ->pack(qw/-side left -fill both -expand 1/);
$tk{output_label}->pack(qw/-side top -fill both/);
$tk{output_list} ->pack(qw/-side top -fill both -expand 1/);
$tk{user_label} ->pack(qw/-side top -fill both/);
$tk{user_list} ->pack(qw/-side top -fill both -expand 1/);
$tk{group_label} ->pack(qw/-side top -fill both/);
$tk{group_list} ->pack(qw/-side top -fill both -expand 1/);
MainLoop;
exit 0;
As you can see from the left frame, the layout of the data (represented in a folder form) is what I am trying to achieve here. So instead of the folders on my C drive I need to display the Departemental data in the same manner.
Thanking You
| [reply] [d/l] |