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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
<manpage cat="cmd" id="image" title="image" version="0.8">
<!-- This file was automatically generated. DO NOT EDIT (yet)! -->
<!--
Copyright (c) 2004 Joe English
image.n,v 1.3 2006/12/09 20:53:50 jenglish Exp
-->
<?TROFF.TH title="image" section="n" date="0.8" source="tile" manual="Tile Widget Set" ?>
<namesection>
<name>ttk_image</name>
<desc>Define an element based on an image</desc>
</namesection>
<synopsis>
<syntax>
<b>style element create</b> <m>name</m> <b cat="AMBIGUOUS canvasitemtype cmd">image</b> <m>imageSpec</m> ?<m>options</m>?
</syntax>
</synopsis>
<section>
<title>DESCRIPTION</title>
<p>The <i>image</i> element factory creates a new element
in the current theme whose visual appearance is determined
by Tk images.
<i>imageSpec</i> is a list of one or more elements.
The first element is the default image name.
The rest of the list is a sequence of <i>statespec / value</i>
pairs specifying other images to use when the element is
in a particular state or combination of states.
</p>
</section>
<section>
<title>OPTIONS</title>
<p>Valid <i>options</i> are:
</p>
<dl>
<dle>
<dt><b>-border</b> <m>padding</m></dt>
<dd><i>padding</i> is a list of up to four integers, specifying
the left, top, right, and bottom borders, respectively.
See <ref refid="image-stretching">IMAGE STRETCHING</ref>, below.
</dd>
</dle>
<dle>
<dt><b>-height</b> <m>height</m></dt>
<dd>Specifies a minimum height for the element.
If less than zero, the base image's height is used as a default.
</dd>
</dle>
<dle>
<dt><b>-padding</b> <m>padding</m></dt>
<dd>Specifies the element's interior padding. Defaults to
<i>-border</i> if not specified.
</dd>
</dle>
<dle>
<dt><b>-sticky</b> <m>spec</m></dt>
<dd>Specifies how the image is placed within the final parcel.
<i>spec</i> contains zero or more characters "n", "s", "w", or "e".
</dd>
</dle>
<dle>
<dt><b>-width</b> <m>width</m></dt>
<dd>Specifies a minimum width for the element.
If less than zero, the base image's width is used as a default.
</dd>
</dle>
</dl>
</section>
<section id="image-stretching">
<title>IMAGE STRETCHING</title>
<p>If the element's allocated parcel is larger than the image,
the image will be placed in the parcel based on the <b>-sticky</b> option.
If the image needs to stretch horizontally (i.e., <b>-sticky ew</b>)
or vertically (<b>-sticky ns</b>),
subregions of the image are replicated to fill the parcel
based on the <b>-border</b> option.
The <b>-border</b> divides the image into 9 regions:
four fixed corners, top and left edges (which may be tiled horizontally),
left and right edges (which may be tiled vertically),
and the central area (which may be tiled in both directions).
</p>
</section>
<section>
<title>EXAMPLE</title>
<example>
set img1 [image create photo -file button.png]
set img2 [image create photo -file button-pressed.png]
set img3 [image create photo -file button-active.png]
style element create Button.button image \
[list $img1 pressed $img2 active $img3] \
-border {2 4} -sticky we
</example>
</section>
<seealso>
<ref>image(n)</ref>
<ref>photo(n)</ref>
</seealso>
<keywords>
<keyword>pixmap theme</keyword>
<keyword>image</keyword>
</keywords>
</manpage>
|