The Dash Patch
The "dash patch" added a variety of new Tk features — primarily to the canvas widget, but in other areas as well.
Canvas Improvements
The dash patch provided several significant improvements to the canvas widget:
Canvas coordinates may be specified as a single list argument instead of individual arguments, which makes it easier to construct commands. Many items now support the notion of a dash pattern for outlines, implemented through a variety of new item options containing the word dash. Windows 95 supports only single-pixel wide dashed lines, whereas other platforms support thick dashed lines. The canvas now includes a state attribute, which modifies the default state of the canvas. Individual canvas objects all have their own -state attributes, which may override the default canvas state. Items also have new attributes to control their appearance based upon their state. The attributes that start with -active control the appearance when the mouse pointer is over the item, while the attributes starting with -disabled control the appearance when the state is disabled. Additionally, disabled canvas items don't react to canvas bindings. Advanced tag searching is available for all canvas operations that accept a tag or item ID as an argument. This adds the ability to search for canvas items based on boolean expressions of tag values. The canvas can generate Postscript for embedded images on all platforms. Additionally, on Unix platforms, it can generate Postscript for embedded widgets currently displayed on the screen (that is, displayed within the canvas's viewport and not obscured by other windows). The internal implementation of the canvas now uses Tcl_Obj values, which improved its performance.
Hidden Text
Tags in text widgets now include an -elide attribute, to hide text with that tag. This feature is used by the popular TkMan manual page browser, which can be used now without patching the Tcl core.
Pointer Warping
Tk applications now have the ability to move the mouse under program control. Use the event generate -warp option when generating KeyPress, KeyRelease, ButtonPress, ButtonRelease, or Motion events. For example:
event generate .c <Motion> -warp 1 -x 10 -y 20
Entry Widget Validation
New options were added to the entry widget for input validation. The options specify command callbacks that are made at various times, such as when the entry widget takes input focus, loses input focus, or has its value change. The commands are subject to % keyword substitution similar to the substitutions in event bindings. The keywords are used to get the name of the entry widget (e.g., %W), the character that is being added, and so forth. (See "Entry Widget Validation" on page 822.)
 |