Hello O’holly Ones

This is also very simple; I have a 3 column table which I would like to display it in this Perl/Tk based form (please see the code below), I have created a frame for this table and also labelled it, However I am not sure on how to create/Insert and populate this table with my values. I have read the Tk.Html and under the heading Tk::Table I found an example which I played around with it trying to understand it, but I still couldn’t grasp the idea. Can someone, “Big Please”, show me how its done.

As always, your divine advice/pointer, or even better, an example is highly appreciated.

BlackAdder
require 5.006; use strict; use Tk 800.005; use Tk::TList; use Tk::Frame; use Tk::DirTree; use Tk::Scrollbar; use Tk::Adjuster; use Tk::DragDrop; use Tk::DropSite; use Tk::Table; use warnings 'all'; use Win32::NetResource; use vars qw/%tk %dr/; $dr{PATH}='c:/'; $dr{server} = ShowServer($dr{PATH}); $dr{perms} = "Permissions: " . $dr{PATH}; $tk{mw} = MainWindow->new (-background=>'white'); $tk{mw}->geometry('700x500'); $tk{top_frame} = $tk{mw}->Frame; $tk{left_frame} = $tk{mw}->Frame; $tk{adjuster} = $tk{mw}-> Adjuster(-widget=>$tk{left_frame},-side=>'le +ft'); $tk{right_frame}=$tk{mw}->Frame; # This frame is where I would like to + have a table. $tk{entry_box}=$tk{top_frame}->Entry(-textvariable=>\ $dr{PATH}); $tk{entry_box_lable}=$tk{top_frame}->Label(-text=>"Path: "); $tk{dir_tree}= $tk{left_frame}->Scrolled('DirTree', -height=>'0', -wid +th=>'0',-scrollbars=>'e',); $tk{dir_tree_label}=$tk{left_frame}->Label(-textvariable=>\ $dr{server +}); $tk{ACL_list}=$tk{right_frame}->Scrolled('TList', -height=>'1', -width=>'1', -scrollbars=>'osoe',); # This list should contain my table $tk{ACL_list_label}=$tk{right_frame}->Label(-textvariable=>\ $dr{perms +}); $tk{entry_box}->bind('<Key-Return>', sub {OnNewPath();}); $tk{top_frame}->pack(qw/-side top -fill x/); $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{entry_box_lable}->pack(qw/-side left -fill both/); $tk{entry_box}->pack(qw/-side top -fill both -expand 1/); $tk{dir_tree_label}->pack(qw/-side top -fill both/); $tk{dir_tree}->pack(qw/-side left -fill both -expand 1/); $tk{ACL_list_label}->pack(qw/-side top -fill both/); $tk{ACL_list}->pack(qw/-side top -fill both -expand 1/); MainLoop; exit(0); sub OnNewPath{ $tk{dir_tree}->delete('all'); $tk{dir_tree}->chdir( $dr{PATH} ); ShowServer($dr{PATH});} sub ShowServer{ my $drive = @_; my $srv; if (Win32::NetResource::GetUNCName(my $unc, $dr{PATH})){ $unc =~ s/^\\\\(\w)+//; $srv = $&; return $dr{server} = "[ Remote Server Name : " . uc($srv) . " +]";} else{ $srv = Win32::NodeName(); return $dr{server} = "[ Local Server Name : " . uc($srv) . " ] +"; }} sub FillTable # or something { #this procedure should populate my table with values which are basical +ly #permission related }

In reply to Tables in Perl/Tk. 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.