TIP 262: Background Images for Frames

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Author:         Eric Taylor <[email protected]>
Author:         Donal K. Fellows <[email protected]>
State:          Draft
Type:           Project
Vote:           In progress
Created:        18-Mar-2006
Post-History:   
Keywords:       Tk,option
Tcl-Version:    8.7
Tk-Branch:      tip-262

Abstract

This TIP proposes an option for frames and toplevels (on the grounds that they're virtually the same thing internally) that allows users to set the background of the window to be an image.

Rationale

Just a there is an -image option for button widgets, this TIP suggests that a -backgroundimage option for frames be implemented. The image should be either an entire single image, or a smaller image that would be tiled, with a -tile option. Tiling would repeat, as needed, a smaller image to fit the visible area of the frame.

If the image was tiled, then it should be re-tiled as needed during a resize. The image would reside behind any other decoration or other widgets that resided in the frame. The image should be re-configurable to replace the image and/or remove it, as with a button image.

This TIP should allow some rather classy looking Tcl/Tk programs to be created with much ease.

Proposed Change

Two new options are proposed for frame and toplevel widgets, to be manipulated using the normal configure and cget methods:

For convenience, an alias for -backgroundimage will also be provided: -bgimg

Implementation

See the tip-262 branch.

Copyright

This document has been placed in the public domain.