1image(n) image(n)
2
3
4
6 image - Define an element based on an image
7
9 style create element name image imageName ?options?
10
12 The image element factory creates a new element in the current theme
13 whose visual appearance is determined by a Tk image.
14
16 Valid options are:
17
18 -border padding
19 padding is a list of up to four integers, specifying the left,
20 top, right, and bottom borders, respectively. See IMAGE
21 STRETCHING, below.
22
23 -height height
24 Specifies a minimum height for the element. If less than zero,
25 the base image's height is used as a default.
26
27 -map { statespec image.. }
28 Specifies auxilliary images to use in different states. Each
29 statespec is a list of state names optionally prefixed by an
30 exclamation point, as in style map. Each imageName is the name
31 of a Tk image defined with image create .... When the element
32 is displayed, each statespec is tested in order, and the image
33 corresponding to the first matching statespec is used. If none
34 match, the base imageName is used.
35
36 -padding padding
37 Specifies the element's interior padding. Defaults to -border
38 if not specified.
39
40 -sticky spec
41 Specifies how the image is placed within the final parcel. spec
42 contains zero or more characters "n", "s", "w", or "e".
43
44 -width width
45 Specifies a minimum width for the element. If less than zero,
46 the base image's width is used as a default.
47
48
50 If the element's allocated parcel is larger than the image, the image
51 will be placed in the parcel based on the -sticky option. If the image
52 needs to stretch horizontally (i.e., -sticky ew) or vertically (-sticky
53 ns), subregions of the image are replicated to fill the parcel based on
54 the -border option. The -border divides the image into 9 regions: four
55 fixed corners, top and left edges (which may be tiled horizontally),
56 left and right edges (which may be tiled vertically), and the central
57 area (which may be tiled in both directions).
58
60 set button(normal) [image create photo -file button.png] set but‐
61 ton(pressed) [image create photo -file button-pressed.png] style ele‐
62 ment create Button.button image $button(normal) \
63 -border {2 4} -map [list pressed $button(pressed)] -sticky nswe
64
66 image(n), photo(n)
67
69 pixmap theme, image
70
71
72
73Tile Widget Set 0.55tile image(n)