This is not necessarily the current version of this TIP.
| TIP: | 71 |
| Title: | Tk Bitmap Improvements |
| Version: | $Revision: 1.1 $ |
| Author: | Chris Nelson <chris at pinebush dot com> |
| State: | Draft |
| Type: | Project |
| Tcl-Version: | 8.4 |
| Vote: | Pending |
| Created: | Friday, 26 October 2001 |
This TIP improves handling of bitmaps in Tk.
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 no way to programmatically list the predefined bitmaps. This TIP adds a number of useful, basic bitmaps and provides for introspection of bitmap names.
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. On 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:
up7x4 up5x3 up3x2 down7x4 down5x3 down3x2 left7x4 left5x3 left3x2 right7x4 right5x3 right3x2
I'd accept arguments that uniform length names like "u7x4" or "uarrow7x4" would be better and I'm mindful of the fact that adding new predefined bitmaps has the potential to collide with application-defined bitmaps but unsure of the workaround for that.
Many (most?) parts of Tcl/Tk can be inspected. You can list font names and families, list windows and find their children, etc., etc. but you need a manual to determine which bitmaps are predefined. I propose to add a [tk bitmaps] command which lists the predefined bitmaps.
SourceForge patch 475332 provides a reference implementation of [tk bitmaps] and a draft of four new bitmaps (8x4 arrows).
https://sourceforge.net/tracker/index.php?func=detail&aid=475332&group_id=12997&atid=312997
This document has been placed in the public domain.
This is not necessarily the current version of this TIP.