nuno Cerqueira wrote:
$widget(Combobox1) list insert end { text1 text2}
but i have the following error message in the end
error in stratup script: invalid command name "ComboBox::list" (....)
"list" is an invalid combobox command. I believe that you are either trying to iterate through an existing list, inserting each member to the index end, or you are trying to furnish the insert command with individual items to append on after another.
Supplying a series of "things" to enter into the widget is simple. If you simply want to supply elements along with the insert command, try it like this:
$widget(Combobox1) insert end $text1 $text2 $text3
Beware though, if $text1 is a list, the whole list will be entered into one index, as demonstrated below.
There is no built-in foreach. You will need to wrap the insert in a loop that iterates through list members if you want to add list elements one at a time, or pick and choose which ones are inserted based on your own criteria.
There are many ways to do this. Here's a crude example that should demonstrate what I've tried to explain:
#!/usr/bin/wish listbox .l pack .l set foo [list 1 2 3 a b c]
for {set i 0} {$i < [llength $foo]} {incr i} {
.l insert end [lindex $foo $i]
}
.l insert end the end. $fooGood luck.
Mike Avery
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ vtcl-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/vtcl-user
