author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 17 Sep 2007 03:12:19 +0000 (23:12 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 17 Sep 2007 03:12:19 +0000 (23:12 -0400) | ||
commit | 3849bfba84fb5b0e9d46920f62105b4e1dd97e63 | |
tree | 2fa7fbd581cd23e9b45b80050799b49d639468ff | tree | snapshot |
parent | 55bad4f096b1f18eec94169c864c39bf0abda1db | commit | diff |
git-gui: Disable native platform text selection in "lists"
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>
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>
git-gui.sh | diff | blob | history | |
lib/browser.tcl | diff | blob | history | |
lib/choose_font.tcl | diff | blob | history |