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
For tktable:
http://tktable.sf.net (included in the ActiveTcl distros)
For Tablelist:
http://www.nemethi.de
Michael
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
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
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