Tk Library Source Code

View Ticket
Login
Ticket UUID: 1053086
Title: A new widget for scrolling many widgets with a ScrolledWidge
Type: RFE Version: None
Submitter: petasis Created on: 2004-10-24 07:04:35
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:26:59
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
Hi all,

I recently needed the functionality of scrolling two 
canvas widgets simultaneously, both of them embedded 
in a ScrolledWindow widget. Of course there are 
hundrends of references for doinh it in c.l.t., but not 
easy to use code. So I decided it to write a BWidget 
widget for doing exactly this.

The attched code is a first implementation of such a 
widget. Of course name/options are open to 
discussion :-)

The idea behind the new widget is simple: when a 
new "MultipleScrollableWidgets" widget is created, only a 
frame widget (without a border) is created. Then the 
user is expected to create all the widgets that will be 
scrolled as children of this frame. Also the user *must* 
pack/place/grid the children onto the frame, in any way 
he wants (i.e. like notebook pages).

Then, each child widget must be declared to the 
MultipleScrollableWidgets widget with 
method "addwidget". Only declared widgets will be 
scrolled. Finally a ScrolledWindow can be created, 
having the MultipleScrollableWidgets widget as 
its "scrollable" widget.

The current implementation has also an option (-scroll) 
to addwidget, for specifying whether each added widget 
will scroll in the x & y direction. I.e,  you can add two 
canvases both of which will be scrolled in the x 
direction, but only the second will be scrollable in the y 
direction (i.e. because the first holds some header items 
we want always visible...)

Any ideas are welcomed. Of course, the final target 
should be to add such a widget in BWidgets :-)
User Comments: petasis added on 2004-10-24 14:04:35:

File Added - 106240: mscrollw.tcl

Attachments: