Staging
v0.5.0
https://github.com/git/git
Revision 3849bfba84fb5b0e9d46920f62105b4e1dd97e63 authored by Shawn O. Pearce on 17 September 2007, 03:12:19 UTC, committed by Shawn O. Pearce on 17 September 2007, 03:12:19 UTC
Sometimes we use a Tk text widget as though it were a listbox.
This happens typically when we want to show an icon to the left
of the text label or just when a text widget is generally a better
choice then the native listbox widget.

In these cases if we want the user to have control over the selection
we implement our own "in_sel" tag that shows the selected region
and we perform our own selection management in the background
via keybindings and mouse bindings.  In such uses we don't want
the user to be able to activate the native platform selection by
dragging their mouse through the text widget.  Doing so creates a
very confusing display and the user is left wondering what it may
mean to have two different types of selection in the same widget.

Tk doesn't allow us to delete the "sel" tag that it uses internally
to manage the native selection but it will allow us to make it
invisible by setting the tag to have the same display properties
as unselected text.  So long as we don't actually use the "sel"
tag for anything in code its effectively invisible.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 55bad4f
History
Tip revision: 3849bfba84fb5b0e9d46920f62105b4e1dd97e63 authored by Shawn O. Pearce on 17 September 2007, 03:12:19 UTC
git-gui: Disable native platform text selection in "lists"
Tip revision: 3849bfb
File Mode Size
lib
.gitignore -rw-r--r-- 62 bytes
GIT-VERSION-GEN -rwxr-xr-x 1.8 KB
Makefile -rw-r--r-- 5.7 KB
git-gui.sh -rwxr-xr-x 64.7 KB

back to top