This is not necessarily the current version of this TIP.
| TIP: | 71 |
| Title: | Tk Bitmap Improvements |
| Version: | $Revision: 1.4 $ |
| 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 |
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 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.
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:
u7x4 u5x3 u3x2 d7x4 d5x3 d3x2 l7x4 l5x3 l3x2 r7x4 r5x3 r3x2
I'm considering adding "arrow_" at the start of each name. 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 the 12 arrow bitmaps.
https://sourceforge.net/tracker/index.php?func=detail&aid=475332&group_id=12997&atid=312997
This document has been placed in the public domain.
Given that Chris implements his own suggestion about adding 'arrow_' at the end of the bitmap names, I find this a fine idea. --KBK kennykb at acm dot org
As discussed on tcl-core, I've created a simple Tcl script to convert ASCII art diagrams like those included in this TIP into XBM format data suitable for passing into [image create bitmap -data ...]. The script and sample usage are attached in the following patch:
http://sourceforge.net/tracker/?func=detail&aid=516751&group_id=12997&atid=312997 --Eric Melski ericm at interwoven dot com
This is not necessarily the current version of this TIP.