Pmw.scrolledText and the <Key> event

Bernard Yue bernie at
Wed Jan 23 21:45:07 EST 2002

Hi Bob,

All Pmw widgets contains a butch of Tkinter widgets.  In your case,
you should trap the eventloop of Pmw.scrolledText._textbox.  You
cannot intercept the <Key> event from Pmw.scrolledText's eventloop
because the parent widget of Pmw.scrolledText._textbox choose
not be pass the event upward, or it was translated to another

Although it works, but it might not be a good idea to intercept the Pmw
interior widget this way.  IMHO, if possible, you should stick with the
Tkinter widgets, and only use Pmw widgets when there is no Tkinter
counterpart (e.g. ComboBox).


Bob Greschke wrote:

> I'm trying to make a Pmw.scrolledText widget non-editable, or
> uneditable, or whatever, by the user.  I made my regular Text widgets
> uneditable by binding them to the <Key> event and calling a handler
> that just returned 'break'.  But it's not working for the scrolledText
> widgets.  They don't seem to be generating the <Key> event.  What
> should I be looking for instead, or is there a better way to make then
> uneditable?
> Thanks!
> Bob

There are three schools of magic.  One:  State a tautology, then ring
the changes on its corollaries; that's philosophy.  Two:  Record many
facts.  Try to find a pattern.  Then make a wrong guess at the next
fact; that's science.  Three:  Be aware that you live in a malevolent
Universe controlled by Murphy's Law, sometimes offset by Brewster's
Factor; that's engineering.

So far as I can remember, there is not one word in the Gospels in
praise of intelligence.
                -- Bertrand Russell

More information about the Python-list mailing list