Текущий индекс можно получить с помощью метода current
:
pack [ttk::combobox .c -values {a b c d e} -state readonly]
# Later, after something is selected...
puts "[.c get] is the current value, [.c current] is the current index"
# Example output: c is the current value, 2 is the current index
Обратите внимание, что в режиме normal
разрешены пользовательские значения, а также значения в раскрывающемся списке. В этом случае метод current
сообщит -1
.