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

Re: git-gui and scrollbars

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 26, 2008, 01:55 UTC
Message-ID
<20080126015540.GP24004@spearce.org>
In-Reply-To
<alpine.DEB.1.00.0801251536250.13600@an.sumeria>
Adam Flott <adam@npjh.com> wrote:
> Is it possible to have git-gui only show the scrollbars when text is too
> large for the window? Or is this a limitation of TK?
Its possible, but its a PITA in Tk.

There isn't a "hide scrollbars unless needed" option in Tk like there is say in Java's Swing library. You have to code up the Tk procedure to dynamically create (and destroy) the scrollbars as necessary based upon the associated text widget's extent.

I've done this in the revision picker megawidget that git-gui uses in the create branch and checkout branch dialogs, but I haven't done it for the blame window, or the diff window, or the file lists.

It also bit me recently as it seems Tk can delete the associated Tcl procedure name for the scrollbar widget but still have the window existing, and then I managed to get another Tk event processed that wanted to update the scrollbar which was now partially destroyed (or maybe it was partially created, I'm not sure). Total suck.

I'm not inclined to do it in those other loctions anytime soon, as I want to do some other GUI rebuilding work first. I imagine I'd try to make the scrollbars hidden when not needed once that work is completed. But its certainly a ways off.

-- 
Shawn.
Previous: Adam Flott
Message 2 of 2 in “git-gui and scrollbars”
  1. Adam FlottJan 25, 2008
  2. Shawn O. PearceJan 26, 2008

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.