Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help about iwidget --selectionbox

Status
Not open for further replies.

newtcl

Programmer
Mar 10, 2003
2
US
I am using iwidget selectionbox in my project. I ran into a problem which is I can not get the value from the selection entry . The code is like following:

frame $c
iwidgets::selectionbox $c.sb -selectionlabel "Ports Number:" -itemslabel "Ports Numbwer" -height 2i -width 1.5i

pack $c.sb

$c.sb insert items end 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400
puts "port number is $port_num before "

set port_num [ $c.sb get ]

# $c.sb selection set 1 ;# default value


puts " port numb is $port_num"


The problem is [$c.sb get ] doesn't work. When I select a item from the list box the value appears in the entry but I can not get teh value by using get command. I can't find any way to get the value . Although it does work if I ran it from tkcon.tcl ( using source to load the file).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top