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
[Button-123-1]
! XPM2
16 7 2 1
* c #000000
. c #ffffff
**..*...........
*.*.*...........
**..*..**.**..**
*.*.*.*.*.*..*.*
**..*..**.*...**
...............*
.............**.
[Button-0815-42]
! XPM2
16 7 2 1
* c #002200
. c #ffff00
**..*...........
*.*.*...........
**..*..**.**..**
*.*.*.*.*.*..*.*
**..*..**.*...**
...............*
.............**.
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
62
63
64
65
66
package Icons;
our $arrow_small_green = <<'END';
/* XPM */
static char *arrow_small[] = {
/* columns rows colors chars-per-pixel */
"19 17 37 1",
" c #04B04F",
". c #0BB04F",
"X c #16B24F",
"o c #1AB24F",
"O c #04AF50",
"+ c #00AF5D",
"@ c #00B050",
"# c #01B050",
"$ c #02B050",
"% c #00B052",
"& c #01B052",
"* c #04B050",
"= c #00B056",
"- c #00B157",
"; c #0AB150",
": c #02B15B",
"> c #00B25D",
", c #04B35F",
"< c #16B250",
"1 c #1DB553",
"2 c #20B44F",
"3 c #21B452",
"4 c #21B55F",
"5 c #3CB955",
"6 c #00B061",
"7 c #00B46F",
"8 c #08B569",
"9 c #0AB66E",
"0 c #1FB968",
"q c #00B470",
"w c #07B670",
"e c #00B677",
"r c #0EB87A",
"t c #4AB955",
"y c #17BC92",
"u c #1EC197",
"i c None",
/* pixels */
"iiiiiiiiiiiiiiiii<y",
"iiiiiiiiiiiiiii5@>i",
"iiiiiiiiiiiiii1@7ii",
"iiiiiiiiiiiii.@qiii",
"iiiiiiiiiiii @6iiii",
"iiiiiiiiiiiO@8iiiii",
"iiiiiiiiii*@:iiiiii",
"iiiiiiiii;@=iiiiiii",
"iiiiiiiiO@@uiiiiiii",
"i<@@iiio@@wiiiiiiii",
"i@@@,it@@6iiiiiiiii",
"ii@@@0@ @iiiiiiiiii",
"iio@@@@ riiiiiiiiii",
"iii*@@@:iiiiiiiiiii",
"iii3@@@eiiiiiiiiiii",
"iiii@@9iiiiiiiiiiii",
"iiii4iiiiiiiiiiiiii"
};
END
1;
use Icons;
$hlist->itemCget($y, $x, -widget)->Photo(-data => $Icons::arrow_small_green, -format => 'xpm');
2014-08-07T13:55:26 KeanWenn du das Modul lädst, dann sind die alle im Speicher, weil es ja Variablen sind.Wenn in dem Modul noch mehr Images hinzu kommen, werden diese dann alle beim Programmstart geladen? Sind also die ganze Zeit im Ramspeicher? Oder nur wenn ich eins lade?
2014-08-08T08:06:49 GwenDragonWarum keine Textdatei?
Die lässt sich sogar schön editieren, das ist doch der Vorteil an den XPM-Grafikformat, es ist Text.
QuoteGibt es keine Möglichkeit die variablen in dem Modul nur bei Aufruf in den Speicher zu laden?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
use strict; use warnings; use Config::IniFiles; do{ my $href = tie my %data, 'Config::IniFiles', -file => *DATA; \%data; }; __DATA__ [foo] bar=123 dog=boo [bar] person=me group=fuzzies
1 2 3 4 5 6 7 8
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $data = require Images; print Dumper $data;
1
2
3
4
5
6
7
8
9
10
$VAR1 = {
'foo' => {
'bar' => '123',
'dog' => 'boo'
},
'bar' => {
'person' => 'me',
'group' => 'fuzzies'
}
};