Menu

#69 tixComboBox entry can't be clear

open
nobody
None
5
2004-03-11
2004-03-11
Pan Chai
No

Hello,

I came across this problem and there is the code

package require Tix

tixComboBox .e -editable true \
-historylimit 20 \
-selectmode browse \
-variable someVar \
-options { \
listbox.height 4 \
entry.background white \
entry.ipady 5 \
}

button .b -text "Clear" \
-command {[.e subwidget entry] delete 0 end}

pack .b -side left
pack .e -side left -fill x -expand 1

bind .e <Return> {[.e subwidget entry] delete 0 end}

Now if a user type a string of text in the entry field, and
click "Clear" button, the text will be cleared. However if
the user finishing typing of a string of text and
hit "Enter" key (Return) the text in the entry field will
not be cleared.

I thought the entry field inherit the characterist of an
entry widget. The basic Entry Widget will clear the field
if <Return> is encountered.

Thanks for any help you could provide.
Pan

Discussion


Log in to post a comment.

MongoDB Logo MongoDB