TIP #71 Version 1.9: Tk Bitmap Improvements

This is not necessarily the current version of this TIP.


TIP:71
Title:Tk Bitmap Improvements
Version:$Revision: 1.9 $
Authors: Chris Nelson <chris at pinebush dot com>
Kevin Kenny <kennykb at acm dot org>
Eric Melski <ericm at interwoven dot com>
State:Draft
Type:Project
Tcl-Version:8.4
Vote:Pending
Created:Friday, 26 October 2001

Abstract

This TIP improves handling of bitmaps in Tk.

Background

Tk has a number of pre-defined bitmaps (10 on all platforms, and 16 more on Macs) but it lacks a number of useful bitmaps and there is no way to programmatically list the predefined bitmaps. This TIP adds a number of useful, basic bitmaps and provides for introspection of bitmap names.

New Bitmaps

Many complex widgets like comboboxes, spinboxes, etc. require arrows bitmaps on buttons. While newer releases of Tk have added more widgets, there will always be some unforeseen need for new or customized widgets. One example is a menubutton which, according to the Microsoft Windows User Experience (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/welcome.asp), should have a downward arrow on the right side. With compound buttons, it is not hard to do:

   button .mb -text Tools -bitmap downarrow -compound right

but there is no stock down-arrow bitmap.

I propose to add 12 bitmaps providing all four directions (up, down, left, and right) in three sizes (3x2, 5x3, and 7x4). The down arrows would look something like:

   @@@@@@@   @@@@@      @@@
   .@@@@@.   .@@@.      .@.
   ..@@@..   ..@..    
   ...@...

I propose the following names:

   arrow_u7x4      arrow_u5x3      arrow_u3x2
   arrow_d7x4      arrow_d5x3      arrow_d3x2
   arrow_l7x4      arrow_l5x3      arrow_l3x2
   arr