Thread Grafikprogramm in Perl (8 answers)
Opened by [E|B] at 2005-08-21 23:33

Crian
 2005-08-23 12:41
#44404 #44404
User since
2003-08-04
5866 Artikel
ModeratorIn
[Homepage]
user image
bequem:

Code: (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
#!/usr/bin/perl
use strict;
use warnings;

use Tk;
use Tk::ROText;

tk_start();
exit;


sub tk_start {
my $mw = new MainWindow;

my $t = $mw->Scrolled(
'ROText',
-scrollbars => 'osoe',
-height => 10,
-width => 50,
-wrap => 'none',
)->pack(
-fill => 'both',
-expand => 1,
);

seek DATA, 0, 0;
while (<DATA>) {
$t->insert('end', $_);
}

MainLoop();
} # sub tk_start

_ _DATA_ _


oder zu Fuß:

Code: (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/perl
use strict;
use warnings;

use Tk;
use Tk::ROText;

tk_start();
exit;


sub tk_start {
my $mw = new MainWindow;

#
# horizontale und vertikale Rollbalken:
#
my $rollx = $mw->Scrollbar(
-orient => 'horizontal',
)->pack(
-side => 'bottom',
-fill => 'x',
);
my $rolly = $mw->Scrollbar(
)->pack(
-side => 'right',
-fill => 'y',
);

#
# Textwidget:
#
my $text = $mw->ROText(
-height => 10,
-width => 50,
-wrap => 'none',
-xscrollcommand => ['set' => $rollx],
-yscrollcommand => ['set' => $rolly],
)->pack(
-fill => 'both',
-expand => 1,
);

#
# Die Rollbalken an das Textwidget binden:
#
$rollx->configure(-command => ['xview' => $text]);
$rolly->configure(-command => ['yview' => $text]);

#
# Textwidget füllen
#
seek DATA, 0, 0;
while (<DATA>) {
$text->insert('end', $_);
}

MainLoop();
} # sub tk_start

_ _DATA_ _


(Leerzeichen zwischen den Unterstrichen entfernen)
s--Pevna-;s.([a-z]).chr((ord($1)-84)%26+97).gee; s^([A-Z])^chr((ord($1)-52)%26+65)^gee;print;

use strict; use warnings; Link zu meiner Perlseite

View full thread Grafikprogramm in Perl