TIP #71: Tk Bitmap Image Improvements


TIP:71
Title:Tk Bitmap Image Improvements
Version:$Revision: 1.14 $
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:Withdrawn
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:

   @@@@@@@   @@@@@      @@@
   [email protected]@@@@.   [email protected]@@.      [email protected]
   [email protected]@@..   [email protected]    
   [email protected]

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.

Donal K. Fellows <donal dot k dot fellows at man dot ac dot uk> writes:

In the long period since this TIP was proposed, the world of GUIs has moved on somewhat. Although the requirement for arrows remains the same, the solutions proposed in this TIP (both originally and as it now stands) do not permit the sort of graphical snazziness that modern users tend to expect. Nor is there a sufficient range of sizes for a reasonable selection to be available for a modern display; even the largest of those arrows would look unusably tiny on my desktop! This indicates that a completely different solution is required, which in turn would be better stated as a separate TIP.

Copyright

This document has been placed in the public domain.


Powered by Tcl[Index] [History] [HTML Format] [Source Format] [LaTeX Format] [Text Format] [XML Format] [*roff Format (experimental)] [RTF Format (experimental)]

TIP AutoGenerator - written by Donal K. Fellows