Tk Source Code

View Ticket
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA
Ticket UUID: 994629
Title: tip 169, peer text widgets
Type: Support Version: None
Submitter: vincentdarley Created on: 2004-07-20 16:20:53
Subsystem: None Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2009-07-29 20:08:34
Resolution: Closed By: vincentdarley
    Closed on: 2004-09-12 12:53:49
The attached patch implements making the 'sel' tag
widget-specific (part of tip169).  

Apparently more of this tip is available here:

A reference implementation based on Tcl 8.4.5 can be
found at
This archive contains modified tkText*.[ch] files that
implement the [$w peer create] and [$w peer names]
methods described above.

So the major remaining component is to make the
pixel-height calculations widget specific.

Contributions encouraged.
User Comments: dkf added on 2009-07-29 20:08:34:

IP - Comment Removed:

dkf added on 2008-11-21 21:27:42:

data_type - 212997

vincentdarley added on 2004-09-12 19:53:49:
Logged In: YES 

This has been applied (note: final patch fixed a few small bugs, 
and added more docs, tests, examples than this)

vincentdarley added on 2004-08-26 19:34:27:

File Deleted - 98442:

vincentdarley added on 2004-08-26 19:34:26:

File Added - 99249: peer-final.diff.gz

vincentdarley added on 2004-08-26 19:34:17:
Logged In: YES 

Updated for final version of the TIP.

vincentdarley added on 2004-08-20 01:34:45:

File Deleted - 98226: 

File Added - 98442: peer7.diff.gz

Logged In: YES 

Fixed one bug, added test, and added example to Tk demos.

vincentdarley added on 2004-08-18 16:21:16:

File Deleted - 98097: 

File Added - 98226: peer6.diff.gz

Logged In: YES 

Added complete docs, more tests, and cleaned some bits up.

vincentdarley added on 2004-08-17 21:01:38:

File Deleted - 97562: 

File Added - 98097: partialPeer5.diff.gz

vincentdarley added on 2004-08-13 17:17:17:

File Deleted - 96462:

vincentdarley added on 2004-08-13 17:14:56:

File Deleted - 97313: 

File Added - 97562: partialPeer4.diff.gz

vincentdarley added on 2004-08-13 17:14:55:
Logged In: YES 

Very good idea.  Easiest would be to provide a substitution
for '%W' (as per bind).  Obviously this would present a very
rare backwards incompatibility (.text window create 1.2
-create {label .text.f -text {I like %W}}), but that seems
rather unlikely in practice.

That would also allow a very neat solution to the correct
behaviour for embedded windows with multiple peers.

Each such peer has its own embedded window, which can be
separately configured (window configure $idx -window) or
created.  These window values cannot be observed in other
peers. (except that their names will still be valid as indices).

Attached a final patch.  Please test.

dkf added on 2004-08-12 14:52:39:
Logged In: YES 

Where windows are embedded using a -create script, it would
at least be possible to give each peer its own window
(though perhaps there'd need to be a substitution in that
case so the script could find out what its containing widget

vincentdarley added on 2004-08-12 01:06:57:
Logged In: YES 

Note: the current implementation takes the following
approach wrt embedded windows:

The peer the window is in displays it.  All other peers
display a blank area of the same size. When the peer that
owns it is destroyed, the embedded window is removed
completely (and the blank spaces therefore disappear).

vincentdarley added on 2004-08-12 01:05:31:

File Deleted - 97300: 

File Added - 97313: partialPeer3.diff.gz

vincentdarley added on 2004-08-11 22:46:59:

File Added - 97300: partialPeer2.diff.gz

vincentdarley added on 2004-08-11 22:38:26:

File Deleted - 96995:

vincentdarley added on 2004-08-11 22:38:20:
Logged In: YES 

Much updated patch, cleaning up the API, with better
comments, etc. It also contains an updated 'undo' API which
allows the undo/redo functionality to work ok with multiple
peers, even when some are deleted and/or renamed.

(i.e. this patch also fixes a bug in Tk 8.4/8.5 in which
'undo' is broken if you rename the widget).

vincentdarley added on 2004-08-09 20:25:16:

File Added - 96995: partialPeer.diff

vincentdarley added on 2004-08-09 20:25:15:
Logged In: YES 

Added implementation which allows partial peers.  It's
somewhat more complex to implement, but works nicely.

vincentdarley added on 2004-08-05 18:15:03:

File Deleted - 96453: 

File Added - 96462: peer5.diff

vincentdarley added on 2004-08-05 18:15:02:
Logged In: YES 

Fixed crash with embedded images.

To Do: 

(1) How to handle embedded windows?  It is impossible in Tk
to display the same embedded window in more than one widget
(for many reasons). Probably the simplest solution is to
make all embedded windows widget-specific, so they only show
up in the widget they were originally been added to. Should
other peers show nothing, or just a grey area?  (The problem
with showing nothing is that it still exists and one could
still delete the embedded window from a peer).

(2) It would be nice to allow 'partial peers'.  By this I
mean a peer widget which only displays a certain section of
the original. For example '.t peer create .peer 5.0 10.0'. 
Which just shows a certain portion of the B-tree.  I don't
believe this would be too hard to implement, although there
would probably need to be a restriction that only whole
lines are shown.

vincentdarley added on 2004-08-05 16:46:16:

File Deleted - 96366: 

File Added - 96453: peer4.diff

vincentdarley added on 2004-08-05 16:46:15:
Logged In: YES 

Completed peer widget implementation.  Needs testing (and
needs a test suite).

vincentdarley added on 2004-08-04 23:53:26:

File Deleted - 96083: 

File Added - 96366: peer3.diff

vincentdarley added on 2004-08-04 23:53:25:
Logged In: YES 

Here's a 95% complete implementation of everything for Tk
8.5.  There are one or two small things still to do, but
this is now suitable for testing purposes.

vincentdarley added on 2004-08-03 00:10:49:

File Added - 96083: peer2.diff

Logged In: YES 

Added most of a widget-specific pixel-height calculation
implementation. API is all there.

vincentdarley added on 2004-07-20 23:20:54:

File Added - 94597: textTag.diff