Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to make a frame with scrollbar

2 views
Skip to first unread message

gk_...@yahoo.com

unread,
Mar 9, 2005, 5:46:27 AM3/9/05
to
Hello

I am trying to make a widget with a table kind of look. My
requirement is to make a table and fill it with the contents of a
file. I have put the widgets creating logic in a for loop. But how do I
make the parent frame scrollable. Following is the code I have used for
creating the table.

frame .dataview.dataviewdialog
pack .dataview.dataviewdialog -side top


for {set i 1} {$i < 10} {incr i} {
frame .dataview.dataviewdialog.frm($i)
entry .dataview.dataviewdialog.frm($i).entr($i) -textvariable
fle_entr -width 30
pack .dataview.dataviewdialog.frm($i).entr($i) -side left
pack .dataview.dataviewdialog.frm($i) -side top
}
}


Here one more problem is that all these 'entry' widget is being
considered as object of same element. When I enter a value in one
entry it is being reflected in all the widgets !! :-(. What is the best
way to get this functionality done.

Thanks
Lin

Michael Schlenker

unread,
Mar 9, 2005, 8:29:43 AM3/9/05
to
gk_...@yahoo.com schrieb:
Start with a better widget, either tktable or tablelist are much better
for the task at hand (and support scrollbars).

For tktable:
http://tktable.sf.net (included in the ActiveTcl distros)

For Tablelist:
http://www.nemethi.de

Michael

Bruce Hartweg

unread,
Mar 9, 2005, 11:32:04 AM3/9/05
to

gk_...@yahoo.com wrote:

I agree with michael - use a table widget,

but as a side note for learning - the reason your entries are
all munged together is you have given them all the same
-textvariable - so they all look alike. If you given them unique
variables (or no variables) then they will behave independently.

Bruce

gk_...@yahoo.com

unread,
Mar 10, 2005, 1:31:09 AM3/10/05
to
Hello

Thanks for the help. My requiredment is to put some buttons also
along with the rows for the user to select the rows for further
processing - if he is interested in. In that case I
guess table widget may not help much. Is there any way to do this.

Thanks
Lin

Bruce Hartweg

unread,
Mar 10, 2005, 1:38:30 AM3/10/05
to
gk_...@yahoo.com wrote:

I'm not a tkTable expert, but you can embed windows (i.e. other widgets
like buttons) in the table. see <http://wiki.tcl.tk/tktable> for some
examples and links to more info.

Of course, you can use a scrolled window from some of the available
extensions, or roll you own by embedding you main frame inside a canvas
widget (search wiki for some examples of that as well)


Bruce

ulis

unread,
Mar 10, 2005, 6:03:20 PM3/10/05
to
0 new messages