For Programmers: Free Programming Magazines  


Home > Archive > Tcl > July 2005 > Re: notebook+scale strange behaviour....









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: notebook+scale strange behaviour....
Robert Heller

2005-07-30, 5:01 pm

"nicolas" <sl1200mk2@gmail.com>,
In a message on 30 Jul 2005 06:42:05 -0700, wrote :

"> i've tried to pack the scale in a canvas with a scrollbar, and the
"> strange behaviour appears.
">
"> if there is no scrollbar, the behaviour is normal.
">
"> so it's not a notebook problem.
"> does anybody know why this appear.....

If you want to use a canvas as a 'scrolling' window, you don't *pack*
(or grid or place) windows in it. Instead you create a window item:

canvas .c
scale .c.s

..c create window 0 0 -window .c.s

Then, you need to update the scrollregion of the canvas:

..c configure -scrollregion [.c bbox all]

It is also possible to 'layer' things using a frame widget -- more
complicated to set up, but easier once set up:

canvas .c
frame .c.f

..c create window 0 0 -window .c.f
bind .c.f <Configure> {ConfigureScrollwindow %W %h %w}

proc ConfigureScrollwindow {frame height width} {
set canvas [winfo parent $frame]

$canvas configure -scrollregion [$canvas bbox all]
}

scale .c.f.s

pack .c.f.s

(I *think* this will work -- I've not tested it.)

OR you can use the tixScrolledWindow widget, which uses a frame, but
does its own geometry management to handle the scrollbars.

">
">

\/
Robert Heller ||InterNet: heller@cs.umass.edu
http://vis-www.cs.umass.edu/~heller || heller@deepsoft.com
http://www.deepsoft.com /\FidoNet: 1:321/153







Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com