Thread Win32::Printer - Drucker auswählen (8 answers)
Opened by Kean at 2011-05-30 12:28

GwenDragon
 2011-05-30 14:49
#149244 #149244
User since
2005-01-17
14745 Artikel
Admin1
[Homepage]
user image
Nein, das musst du selber machen.

Ungetestet:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
use Win32::GUI();

my $selected_item;
my @drucker = ('HP Inkjet', 'Laser 2');

my $main = Win32::GUI::Window->new(-name => 'Main', -text => 'Druckerauswahl', -width => 200, -height => 200);

my $lv = $main->AddListView(
  -singlesel => 1,
   -pos  => [ 0, 0 ],
   -size => [ 190, 125 ],
 );
 
$lv->InsertColumn(
   -index => 0,
   -text  => "Drucker",
 );
 
$lv->ColumnWidth(0,180);

for my $dr (@drucker) {
  $lv->InsertItem(-text => $dr);
}

$main->AddButton(
        -name    => "IB",
        -text    => "Drucker setzen",
        -onClick => \&savePrinter,
);

$main->Show();

Win32::GUI::Dialog();

sub lv_Click {
  ($selected_item) = $lv->SelectedItems();
}

sub savePrinter { # hier Drucker abspeichern!!!!
  $selected_item;
}

sub Main_Terminate {
        -1;
}

Last edited: 2011-05-30 14:55:48 +0200 (CEST)

View full thread Win32::Printer - Drucker auswählen