Hi thundergnat

Again I thanks you for your sample. From the sample you have given, i got a idea of using "Listbox" option for my requirement. Also I have tried that with success

Below I have pasted my final completed code, may be it would be useful for somebody

use strict; use warnings; use Tk; use Tk::ROText; use win32; use Win32::FileOp; use File::Find; use Tk::LabFrame; use Tk::LabEntry; my @filename; my $w; my $TagType; my $var; my $fileList; my $mw = new MainWindow; $mw -> setPalette('#EEEEEE'); $mw->resizable('no', 'no'); $mw -> title("get File List"); my $frame = $mw -> Frame -> pack (-side => 'top', -fill => 'both', -ex +pand => 1, -padx => '12', -pady => '12'); my $frame1 = $frame -> Frame -> pack (-side => 'left'); $frame1 -> Button (-text => 'Add Files...', -command => \&openFile, -b +ackground => '#E9F0F7', -activebackground => '#B8C4E5') -> pack (-sid +e => 'top', -padx => '0', -pady => '10', -anchor => 'e'); my $frame3a = $mw -> Frame () -> pack (-side => 'top', -fill => 'both' +, -expand => 1, -padx => 12, -pady => '6'); my $frame3 = $frame3a -> LabFrame (-label => "Add Files, and then arra +nge them in the order you want.", -font => 'Arial-Bold 11', -labelsid +e => "acrosstop") -> pack (-anchor => 'w'); my $ins = $frame3 -> Scrolled("Listbox", -scrollbars => 'e', -width => + '90', -background => 'white') -> pack(-side => 'top', -pady => '12', + -padx => '12', -fill => 'both', -expand => 1); my $frame4 = $frame3 -> Frame () -> pack (-side => 'top', -fill => 'bo +th', -expand => 1, -padx => '12'); my $frame5 = $frame4 -> Frame -> pack (-side => 'left'); my $frame6 = $frame4 -> Frame -> pack (-side => 'left'); $frame6 -> Button (-text => 'Move Up', -command => \&moveUP, -backgrou +nd => '#E9F0F7', -activebackground => '#B8C4E5', -width => '11') -> p +ack (-side => 'top', -padx => '6', -pady => '10', -anchor => 'w'); my $frame7 = $frame4 -> Frame -> pack (-side => 'left'); $frame7 -> Button (-text => 'Move Down', -command => \&moveDown, -back +ground => '#E9F0F7', -activebackground => '#B8C4E5', -width => '11') +-> pack (-side => 'top', -padx => '0', -pady => '10', -anchor => 'w') +; my $frame8 = $frame4 -> Frame -> pack (-side => 'left'); $frame8 -> Button (-text => 'Remove', -command => \&removePages, -back +ground => '#E9F0F7', -activebackground => '#B8C4E5', -width => '11') +-> pack (-side => 'top', -padx => '6', -pady => '10', -anchor => 'w') +; my $frame10 = $mw -> Frame -> pack (-side => 'bottom', -fill => 'both' +, -expand => 1, -padx => '12'); my $frame11 = $frame10 -> Frame -> pack (-side => 'right'); $frame11 -> Button (-text => 'Cancel', -command => sub{$mw -> destroy; +}, -background => '#E9F0F7', -activebackground => '#B8C4E5', -width = +> '9') -> pack (-side => 'top', -pady => '10', -anchor => 'ne'); my $frame12 = $frame10 -> Frame -> pack (-side => 'right'); $frame12 -> Button (-text => 'Process', -command => \&process, -backgr +ound => '#E9F0F7', -activebackground => '#B8C4E5', -width => '9') -> +pack (-side => 'top', -padx => '0', -padx => '6', -pady => '10', -anc +hor => 'ne'); MainLoop; sub openFile { my @types = ( [ "3d Files", '.3d' ], [ "All files", '*' ] ); @filename = $mw->getOpenFile( -filetypes => \@types, -defaultextension => '.3d', -title => 'file to read', -multiple => 1, ); $mw->Unbusy; return 'Cancel' unless (@filename); foreach my $single(@filename) { $ins->insert( 'end', "$single" ); } } sub gotoSave { my $ExtractedStream = $w->get("1.0", "end"); print "$ExtractedStream"; } sub gotoClear { $ins -> delete ("1.0", "end"); } sub moveUP { my @fileList = $ins->curselection(); my $selIndex = $fileList[0]; $selIndex = $selIndex-1; $fileList = $ins->get(@fileList); $ins->delete(@fileList); $ins -> insert($selIndex, $fileList); $ins->selectionSet($selIndex); } sub moveDown { my @fileList = $ins->curselection(); my $selIndex = $fileList[0]; $selIndex = $selIndex+1; $fileList = $ins->get(@fileList); $ins->delete(@fileList); $ins -> insert($selIndex, $fileList); $ins->selectionSet($selIndex); } sub removePages { my @fileList = $ins->curselection(); $ins->delete(@fileList); } sub process { my @colList = $ins -> get(0, 'end'); my $count = 1; foreach my $single(@colList) { print "$count\. $single\n"; $count++; } }

I have learned the following new things from your code

1. gif as a data within perl script

2. -multiple file selection option in "getOpenFile"

3. DragDrop and DropSite modules

4. Different way of coding with Tk

Once again thanks for teaching me all these things from a discussion

Thanks

Srikrishnan R.


In reply to Re^4: TK Help by srikrishnan
in thread TK Help by srikrishnan

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.