home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / tcl / 2137 < prev    next >
Encoding:
Internet Message Format  |  1992-12-17  |  1.6 KB

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