Thread Dateiauswahl: Mit Hilfe Tk eine Datei auswählen (9 answers)
Opened by Schreiberling at 2006-08-07 14:00

renee
 2006-08-09 21:32
#45764 #45764
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
So funktionierts:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use strict;
use warnings;
use Tk;

my $path;
my $mw = tkinit();
$mw->Entry(-textvariable => \$path)->pack();
$mw->Button(-command => \&search_file, -text => 'Datei wählen')->pack();

MainLoop;

sub search_file{
my @filetypes = (['All Images', ['.GIF','.XBM','.XPM','.BMP']],
['All Images',['.PNG','.PPM','.PGM','.JPEG','.JPG']],);
$path = $mw->getOpenFile(-filetypes => \@filetypes);
}


Ich habe zwei Mal 'All Images', die aber zusammengeführt werden. Ich habe das gemacht, weil es unter Windows einen Bug gibt (siehe auch rt.cpan.org)
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Dateiauswahl: Mit Hilfe Tk eine Datei auswählen