Documentation‎ > ‎Display‎ > ‎

gnocl::image

A widget which displays an image.

Synopsis

gnocl::image [-option value...]

Screenshot

Options

-image percent-string (default: "")
Image to be shown, can be either a file (prefix "%/"), a stock item (prefix "%#") or gnocl::pixBuf (prefix "%?).
-stockSize one of menu, smallToolBar, largeToolBar, button, dnd, or dialog (default: button)
Size of the image. This option is only valid for a stock image.
-align one of topLeft, top, topRight, left, center, right, bottomLeft, bottom, or bottomRight
Alignment of the image.
-xPad integer (default: 0)
Horizontal padding.
-yPad integer (default: 0)
Vertical padding.
-size  integer or list-of-two-integer
Width and height in pixel. If only one value is given, both sizes are the same. The original image is not remembered, that means that if for example an image is first scaled by 0.5 (half size) and then scaled by 2 (double size) it does not look like the original one, since by decreasing its size information is lost which cannot be recovered. This option is only valid for pixbuf images, i.e. not animated images from file.
-visible boolean (default: 1)
Whether or not the item is visible.
-sensitive boolean (default: 1)
Whether or not the item is sensitive to user input.
-name string
Name of the widget, can be used to set options in an rc file.

Description

An image widget shows an image. Different formats and animation are supported.

Commands

id delete
Deletes the widget and the associated tcl command.
id configure [-option value...]
Configures the widget. Option may have any of the values accepted on creation of the widget.

Example

set img [gnocl::image \
    -image "%#SaveAs" \
    -stockSize dialog]

gnocl::window \
    -title "Image" \
    -child $img


Comments