{"thread":{"id":"11737","subject":"git-gui and scrollbars","startedAt":"2008-01-25T21:39:47Z","lastAt":"2008-01-26T01:55:40Z","messageCount":2,"participants":["Adam Flott","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"66598","messageId":"alpine.DEB.1.00.0801251536250.13600@an.sumeria","threadId":"11737","inReplyTo":null,"subject":"git-gui and scrollbars","fromName":"Adam Flott","fromEmail":"adam@npjh.com","sentAt":"2008-01-25T21:39:47Z","receivedAt":"2008-01-25T21:39:47Z","isPatch":false,"sender":{"key":"adam@npjh.com","avatar":"https://gravatar.com/avatar/b1499b03b4ec6de9607c0cc5c57de362b328a9cf646277f8f77b12f80c0e6228?d=mp&s=160"},"body":"Is it possible to have git-gui only show the scrollbars when text is too\nlarge for the window? Or is this a limitation of TK?\n\n\nAdam\n"},{"id":"66619","messageId":"20080126015540.GP24004@spearce.org","threadId":"11737","inReplyTo":"alpine.DEB.1.00.0801251536250.13600@an.sumeria","subject":"Re: git-gui and scrollbars","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-01-26T01:55:40Z","receivedAt":"2008-01-26T01:55:40Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Adam Flott <adam@npjh.com> wrote:\n> Is it possible to have git-gui only show the scrollbars when text is too\n> large for the window? Or is this a limitation of TK?\n\nIts possible, but its a PITA in Tk.\n\nThere isn't a \"hide scrollbars unless needed\" option in Tk like\nthere is say in Java's Swing library.  You have to code up the Tk\nprocedure to dynamically create (and destroy) the scrollbars as\nnecessary based upon the associated text widget's extent.\n\nI've done this in the revision picker megawidget that git-gui uses\nin the create branch and checkout branch dialogs, but I haven't\ndone it for the blame window, or the diff window, or the file lists.\n\nIt also bit me recently as it seems Tk can delete the associated Tcl\nprocedure name for the scrollbar widget but still have the window\nexisting, and then I managed to get another Tk event processed that\nwanted to update the scrollbar which was now partially destroyed\n(or maybe it was partially created, I'm not sure).  Total suck.\n\nI'm not inclined to do it in those other loctions anytime soon,\nas I want to do some other GUI rebuilding work first.  I imagine\nI'd try to make the scrollbars hidden when not needed once that\nwork is completed.  But its certainly a ways off.\n\n-- \nShawn.\n"}]}