git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Adam Flott <adam@npjh.com>
Cc: git@vger.kernel.org
Subject: Re: git-gui and scrollbars
Date: Fri, 25 Jan 2008 20:55:40 -0500	[thread overview]
Message-ID: <20080126015540.GP24004@spearce.org> (raw)
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.

      reply	other threads:[~2008-01-26  1:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25 21:39 git-gui and scrollbars Adam Flott
2008-01-26  1:55 ` Shawn O. Pearce [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080126015540.GP24004@spearce.org \
    --to=spearce@spearce.org \
    --cc=adam@npjh.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).