3.6.1 TopWindow objects

class TopWindow( )
Create a TopWindow object.

TopWindow objects have the following methods and properties:

show( )
Shows the window. The window is not shown until show() is called.

hide( )
Hides the window.

add_image( image, position)
Inserts an image object graphics.Image into the window. The position of the image is specified by the (position) parameter. If only the coordinates of the top left corner are specified, like (x1, y1) the image is not resized. If four coordinates are given, like(x1, y1, x2, y2), the image is resized to fit to the specified area.
add_image(image, (10,20))
add_image(image, (10,20,20,30))

remove_image( image[,position])
Removes the image from the window. Mandatory parameter image must be a graphics.Image object. Parameter position may specify the top-left corner coordinates of the image or the rectangular area of the image. If only image parameter is given, all the pictures representing this image object are removed from the window. If both parameters are given, only the picture that matches both parameters is removed.
remove_image(image, (10,10))
remove_image(image, (10,10,20,20))

Specifies the coordinates of the top left corner of the window. Can be read and written.
position = (10, 20)

Specifies the size of the window. Can be read and written.
size = (100, 200)

The images inserted into the window. Defined as a list of tuple objects. Each tuple contains a graphics.Image object and the position of the image. The position may specify the top-left coordinate of the image and optionally also the bottom-right coordinate of the image. Parameter (x,y) specifies the top-left coordinate, but does not resize the image while parameter like (x1,y1,x2,y2) specifies both the top-left and bottom-right coordinates and possibly also resizes the image. Can be read and written. Also see the add_image() and remove_image() methods.
images = [(image1,(x1,y1)), (image2,(x1,y1,x2,y2)), (image3,(50,50,100,100))]
sets the window content to be 3 images. image2 and image3 are possibly resized while the image1 is not)

Specifies if the shadow of the window is shown and the length of the shadow. Can be read and written. Setting shadow = 0 makes the shadow invisible.
Example: shadow = 5

Specifies the corner type of the window. Can be read and written. Corner type can be one of the following values:

Example: corner_type = "square"

Returns the maximum size of the window as a tuple (width, height). Read only property.

The background color of the window as an integer (e.g. 0xaabbcc). The two greatest hexadecimal digits specify the red, the next two specify the blue and the last ones specify the green color. Can be read and written.
Example: background_color = 0xffffff (sets the white color)

Can be set to 0 or 1. 1 means that window is visible, 0 means that it is not. Can be read and written. Also see the show and hide methods.

See About this document... for information on suggesting changes.