Tkinter events - how to make a "change" event?
Thomas Lane
tom at parlant.com
Mon Mar 6 11:14:24 EST 2000
At first it didn't work, but after a bit of experimenting, I found that
I needed to set "entryfield_modifiedcommand = myCallbackFunction"
instead of "entry_modifiedcommand = ...". The Pmw documentation was
wrong, but I got the thing working. Thanks for the help, Greg.
Greg McFarlane wrote:
>
> It looks like you may be doing this:
> combobox.bind('<blah>', blah)
> when you probably should be doing this:
> combobox.component('entry').bind('<blah>', blah)
> The former puts the binding on the megawidget's hull component (the
> containing frame).
>
> But you really should be using the modifiedcommand option of the
> combobox's entry component:
> combobox = Pmw.ComboBox(...
> entry_modifiedcommand = myCallbackFunction,
> ...)
>
> From the Pmw.EntryField manual page:
> modifiedcommand
> This is called whenever the contents of the entry has been
> changed due to user action or by a call to setentry().
>
More information about the Python-list
mailing list