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

Re: Re: Add new option in the right click menu in git gui

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Mar 26, 2010, 13:53 UTC
Message-ID
<20100326135346.GB22339@book.hvoigt.net>
In-Reply-To
<36ca99e91003011345n43aad0c5m5c02eaf692d54efd@mail.gmail.com>
Hi,
this email has been lying in my mailbox for while ...
On Mon, Mar 01, 2010 at 10:45:10PM +0100, Bert Wesarg wrote:
Show 6 quoted lines
> Actually, I would like to be able to have a right click menu for the
> path too and have access to the guitool entries in the Tools menu
> which require a path (ie. needsfile=true). That would reduce by mouse
> movements drastically.
> 
> I have looked into this issue by myself, but I'm not that familiar with tcl/tk.

Just try it. The "Tcl Introduction" sample chapter from this book[1] explains the tcl language in 17 pages quite nicely.

I thought of this myself but never had the time to do it. If you are still interested in implementing it take a look at the 'bind' command. It lets you bind procedures to events that occur on widgets or the application. For the diff view this is done in git-gui.sh on around line 3465 with this command:

  bind_button3 $ui_diff [list popup_diff_menu $ctxm $ctxmmg $ctxmsm %x %y %X %Y]

bind_button3 is just a wrapper so bind is platform independent. So you probably want to implement a method similar to popup_diff_menu which popups the right menu for the selected file.

BTW, the widgets for the files are of the same type (text) as $ui_diff and are stored in the variables: $ui_index and $ui_workdir for the index and working directory respectively.

Hope that helps.
cheers Heiko
[1] http://www.beedub.com/book/
Previous: Bert Wesarg
Message 5 of 5 in “Add new option in the right click menu in git gui”
  1. Sylvain RabotFeb 18, 2010
  2. Heiko VoigtMar 1, 2010
  3. Sylvain RabotMar 1, 2010
  4. Bert WesargMar 1, 2010
  5. Heiko VoigtMar 26, 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.