TIP #71 Version 1.13: Tk Bitmap Image Improvements

This is not necessarily the current version of this TIP.


TIP:71
Title:Tk Bitmap Image Improvements
Version:$Revision: 1.13 $
Authors: Chris Nelson <chris at pinebush dot com>
Kevin Kenny <kennykb at acm dot org>
Eric Melski <ericm at interwoven dot com>
Donal K. Fellows <donal dot k dot fellows at man dot ac dot uk>
State:Draft
Type:Project
Tcl-Version:8.5
Vote:Pending
Created:Friday, 26 October 2001

Abstract

Tk has a number of pre-defined bitmaps (10 on all platforms) but it lacks a number of bitmaps useful for creating GUI elements. This TIP adds several such bitmaps (as bitmap images).

New Bitmaps

Many complex widgets like comboboxes, spinboxes, etc. require arrows pictures 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 [1], should have a downward arrow on the right side. With compound buttons, it is not hard to do:

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

but there is no stock down-arrow image.

I propose to add 12 bitmap images providing all four directions (up, down, left, and right) in three sizes (3x2, 5x3, and 7x4) in black. 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
   arrow_r7x4      arrow_r5x3      arrow_r3x2

I'm mindful of the fact that adding new predefined bitmap images has the potential to collide with application-defined images or other commands but I'm unsure of the workaround for that.

Reference Implementation

SourceForge patch 475332 provided a reference implementation of a previous version of this proposal [2]. This version is not implemented yet.

Commentary

Donal K. Fellows <donal dot k dot fellows at man dot ac dot uk> writes: Previous versions of this TIP proposed fixing the problem using bitmaps instead of bitmap images and added an infrastructure for tracking those bitmaps. Since I think that ultimately we should be getting rid of bitmaps and instead using something based on the image infrastructure (which already has proper introspection support) those parts of this TIP have been removed. However, making the changes to effect the switch to using bitmap images instead of bitmaps for things like stippes, cursors, etc. lies outside the scope of this TIP.

Copyright

This document has been placed in the public domain.


Powered by TclThis is not necessarily the current version of this TIP.

TIP AutoGenerator - written by Donal K. Fellows