git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: Make text selectable on Mac

From
SHStefan Haller <lists@haller-berlin.de>
Date
Nov 14, 2010, 12:22 UTC
Message-ID
<1289737376-33373-1-git-send-email-lists@haller-berlin.de>
From: Stefan Haller <stefan@haller-berlin.de>

Stolen from git-gui, 23effa79f7 (original log message by Shawn O. Pearce <spearce@spearce.org> follows):

    git-gui: Force focus to the diff viewer on mouse click.
    Apparently a "feature" of Tcl/Tk on Mac OS X is that a disabled text
    widget cannot receive focus or receive a selection within it.  This
    makes the diff viewer almost useless on that platform as you cannot
    select individual parts of the buffer.
    Now we force focus into the diff viewer when its clicked on with
    button 1.  This works around the feature and allows selection to
    work within the viewer just like it does on other less sane systems,
    like Microsoft Windows.
Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 45e3380..14ffde2 100755
--- a/gitk
+++ b/gitk
@@ -2453,6 +2453,7 @@ proc makewindow {} {
     global ctxbut
     bind $cflist $ctxbut {pop_flist_menu %W %X %Y %x %y}
     bind $ctext $ctxbut {pop_diff_menu %W %X %Y %x %y}
+    bind $ctext <Button-1> {focus %W}
 
     set maincursor [. cget -cursor]
     set textcursor [$ctext cget -cursor]
-- 
1.7.3.2.154.gcfae0
Next: Paul Mackerras
Message 1 of 2 in “gitk: Make text selectable on Mac”
  1. gitk: Make text selectable on MacStefan Haller, Nov 14, 2010
  2. Paul MackerrasDec 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.