- a large BTree containing all the text, tags, marks, etc
- the undo/redo stack
- etc.
Video Demo edit
The problem is how to implement this, given that Tk 8.5 has added the requirement for all widget logical lines to cache their display pixel heights. The pixel height of any logical line will typically depend on the widget it's in (particularly the width of that widget, unless we have disabled text wrapping). This means we will typically need for each logical line one pixel height cache for each peer widget. On top of that the internal 'Node' structures in the BTree also store the pixel height at that point in the tree, so we'll need multiple pixel heights there.It seems there are two possible implementation strategies:- dynamically extend the TkTextLine and Node structures to maintain one such pixel count for each peer widget
- store the pixel information in a separate widget-specific data structure
Another implementation issue is whether it is currently possible in Tk to have the same embedded image or embedded window show up in two text widgets simultaneously? Remember you can embed images or arbitrary widgets inside a text widget, but can those be displayed in two places at once?DKF: Duplicating images is easy; the Tk image infrastructure is designed for it. Arbitrary widgets are not duplicatable.
Duoas: I am (ambivalently) really excited about this. However, sometimes you want the text to vary from its peer. The quintessential examples are already given: sel, insert, current. I'd like to be able to make a tag appear in one peer and not another. (Without that capability, I am stuck doing the "copy and paste" peer method.) I'm bound and determined to make my application work like it ought, and not the way existing software thinks it ought, so either way I just thought I'd throw that suggestion out there for y'all.