What comes to mind, from your description of wanting to select multiple files simultaneously is the "listbox". You can choose it's -selectmode to "multiple", and load in your files.

Here is a fancy version I gleamed from the usenet, which uses drag'n'drop. Select A and D, then drag one to the yellow area. I think it's close to what you want. Just substitute your filenames for A..Z.

#!/usr/bin/perl use Tk; use Tk::DragDrop; use Tk::DropSite; use strict; my $var; my $curindex; my $mw=tkinit; my $listframe = $mw->Scrolled( 'Listbox', -selectmode=>'multiple', -scrollbars=>'oe')->pack; my $listbox = $listframe->Subwidget('scrolled'); $mw->Label(-text=>'Yellow Entry is the DropSite')->pack; my $entry = $mw->Entry(-bg=>'yellow')->pack; $listframe->insert('end',('A'..'Z')); my $token = $listbox->DragDrop( -event => '<B1-Motion>', -sitetypes => [qw/Local/], -startcommand=>\&draghandler, ); $entry->DropSite( -droptypes => [qw/Local/], -dropcommand => [\&fillEntry,$entry,$listbox], ); $listbox->bind('<ButtonPress-1>',sub { my $e=$listbox->XEvent; $curindex=$listbox->nearest($e->y); }); MainLoop; sub draghandler { #Force selection of the index under the mouse $listbox->selectionSet($curindex,$curindex); } sub fillEntry { my ($e,$l)=@_; $var=''; $e->delete(0,'end'); foreach ($l->curselection){ $var=$var.$l->get($_); } $e->insert('end',$var); $l->selectionClear(0,'end'); } __END__

I'm not really a human, but I play one on earth. flash japh

In reply to Re: The right Tk file selecter by zentara
in thread The right Tk file selecter by etcshadow

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.