Defining event handlers for Tk Canvas, TkZinc 3.3.4, TkPath and Tk Text-Tags is the same as for windows inside Jeszra. However the technical details vary a great deal and also the generated code.
Jeszra only generates code for event handlers associated (bind) with the window path name. In contrast to this every tag is retrieved for TkZinc 3.3.4, TkPath and Tk canvas object!
The Inspector displays and maintains only event handlers for the left-most tag; in case of TkZinc 3.3.4 only the type of the graphical object extended with a number. For a canvas and TkPath the left-most tag is similar to a window path name and serves as an identifier. »-tags« is a object property listing all the tags associated with this object.
Event handler for other tags can be defined via the shell as-well. And code is being generated for these event handlers, too.
The »-tags« property provides the functionality of »bindtags« for a graphical object.
in Figure 8.4, “The Tags Property” all Inspector event handlers are bound to ».top_1.canvas_1.arc_1« –the graphical object is of kind »arc«. Within a TkZinc 3.3.4 window the tag would be »arc_1«.
Example 8.4. Other Tags
Select the canvas window in the hierarchy view. The »w« variable reflects the selected window.
Jeszra: +- Local: $w bind symbolTag { doSomeThingWithThisTag %W symbolTag }
Example 8.4, “Other Tags” displays how additional event handler sets can be used for a Tk canvas, TkPath and TkZinc 3.3.4 window. way.
Tk text window, operate differently to graphical windows. A text window consist of floating text –including images and windows–, tags and the ranges from those tags.
A text tag is mostly a format descriptor. Inside of Jeszra text tags are explicitly created and accessible from within hierarchy view. Each text tag has properties, geometry and associated events. All of which are customizable inside the Inspector. Geometry for a text tag consists of list of ranges; a range is a pair of indices inside the floating text.