From: Paul Mackerras Date: Sun, 21 Sep 2008 23:11:37 +0000 (-0500) Subject: gitk: Use for context menus on OSX X-Git-Tag: v1.6.1-rc1~2^2~30 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d277e89f87fda01daa1e1a35fc1f7118678faa1f;p=git.git gitk: Use for context menus on OSX An OSX user has reported that gitk's context menus are not usable under OSX because it doesn't provide a way to generate events. Users can generate events with command+click, so use that for the context menus instead on OSX. Signed-off-by: Paul Mackerras --- diff --git a/gitk b/gitk index 2eaa2ae7d..e61e68b88 100755 --- a/gitk +++ b/gitk @@ -2166,7 +2166,8 @@ proc makewindow {} { bind $cflist <1> {sel_flist %W %x %y; break} bind $cflist {sel_flist %W %x %y; break} bind $cflist {treeclick %W %x %y} - bind $cflist {pop_flist_menu %W %X %Y %x %y} + global ctxbut + bind $cflist $ctxbut {pop_flist_menu %W %X %Y %x %y} set maincursor [. cget -cursor] set textcursor [$ctext cget -cursor] @@ -4919,7 +4920,7 @@ proc drawcmittext {id row col} { global rowtextx idpos idtags idheads idotherrefs global linehtag linentag linedtag selectedline global canvxmax boldrows boldnamerows fgcolor - global mainheadid nullid nullid2 circleitem circlecolors + global mainheadid nullid nullid2 circleitem circlecolors ctxbut # listed is 0 for boundary, 1 for normal, 2 for negative, 3 for left, 4 for right set listed $cmitlisted($curview,$id) @@ -4992,7 +4993,7 @@ proc drawcmittext {id row col} { } set linehtag($row) [$canv create text $xt $y -anchor w -fill $fgcolor \ -text $headline -font $font -tags text] - $canv bind $linehtag($row) "rowmenu %X %Y $id" + $canv bind $linehtag($row) $ctxbut "rowmenu %X %Y $id" set linentag($row) [$canv2 create text 3 $y -anchor w -fill $fgcolor \ -text $name -font $nfont -tags text] set linedtag($row) [$canv3 create text 3 $y -anchor w -fill $fgcolor \ @@ -5334,7 +5335,7 @@ proc bindline {t id} { proc drawtags {id x xt y1} { global idtags idheads idotherrefs mainhead global linespc lthickness - global canv rowtextx curview fgcolor bgcolor + global canv rowtextx curview fgcolor bgcolor ctxbut set marks {} set ntags 0 @@ -5412,7 +5413,7 @@ proc drawtags {id x xt y1} { if {$ntags >= 0} { $canv bind $t <1> [list showtag $tag 1] } elseif {$nheads >= 0} { - $canv bind $t [list headmenu %X %Y $id $tag] + $canv bind $t $ctxbut [list headmenu %X %Y $id $tag] } } return $xt @@ -9851,6 +9852,13 @@ set selectbgcolor gray85 set circlecolors {white blue gray blue blue} +# button for popping up context menus +if {[tk windowingsystem] eq "aqua"} { + set ctxbut +} else { + set ctxbut +} + ## For msgcat loading, first locate the installation location. if { [info exists ::env(GITK_MSGSDIR)] } { ## Msgsdir was manually set in the environment.