Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
my $InputLabel = $main->Button(
    -text             => 'sélection',
    -activeforeground => 'red',
    -borderwidth      => 5,
    -command          => [ \&Input_file, $main, \@filetypes],
);
 
...
 
 
sub Input_file {
	my ($main, $ref_filetypes) = @_;
 
	my $fichier_input = $main->getOpenFile(
	  -filetypes => $ref_filetypes,
	);
	return $fichier_input;
}
Y a-t-il moyen de récupérer la valeur via le return?


Sinon, je fais ainsi :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
my $fichier_input;
 
my $InputLabel = $main->Button(
    -text             => 'sélection',
    -activeforeground => 'red',
    -borderwidth      => 5,
    -command          => [ \&Input_file, $main, \@filetypes],
); 
 
 
sub Input_file {
	my ($main, $ref_filetypes) = @_;
 
	$fichier_input = $main->getOpenFile(
	  -filetypes => $ref_filetypes,
	);
}
... mais je ne sais pas si c'est très propre.


Merci,