home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!agate!sprite.Berkeley.EDU!ouster
- From: ouster@sprite.Berkeley.EDU (John Ousterhout)
- Newsgroups: comp.lang.tcl
- Subject: Re: Disappearing scrollbars?
- Date: 17 Dec 1992 16:36:18 GMT
- Organization: U.C. Berkeley Sprite Project
- Lines: 23
- Distribution: world
- Message-ID: <1gqaa2INNd3e@agate.berkeley.edu>
- References: <1goe48INN3sg@agate.berkeley.edu>
- NNTP-Posting-Host: tyranny.berkeley.edu
-
- In article <1goe48INN3sg@agate.berkeley.edu>, joel@saffron.CS.Berkeley.EDU (Joel A. Fine) writes:
- |> Hi,
- |>
- |> Is it possible to arrange for a scrollbar which only appears if there is
- |> enough information in its corresponding window to have reason to scroll?
- |> E.g. if an entry window is filled with text, have a scrollbar appear, but
- |> in (say) the normal case, when there is only a little text in the entry window,
- |> no scrollbar? Or, if a listbox has few enough entries that they are all visible,
- |> no scrollbar, but if some are invisible, scrollbar appears?
- |>
- |> I suppose I could do it manually with bindings and packing/unpacking at the
- |> right moment, but that seems a bit cumbersome. Any suggestions?
- |>
- |> - Joel
-
- There's no built-in mechanism for this, but this shouldn't be hard to
- fake up at Tcl level. I think that the best way to do it is to set the
- "-yscrollcommand" option for the widget to call a procedure rather than
- talking directly to the scrollbar. The procedure can then check to see
- if the entire object appears in the window (there's enough info passed
- out by the widget to do this) and it can create or delete the scrollbar
- accordingly (and also call the scrollbar's procedure to actually set the
- values in the scrollbar).
-