[Tutor] disabling Pmw ComboBox's EntryField? [quick lambda hacks]

Lance E Sloan lsloan@umich.edu
Mon, 18 Feb 2002 10:14:04 -0500


Danny Yoo wrote:
[...]
> implies that self.cboxDomain.invoke() doesn't need to take the 'event'
> parameter that get's passed when we bind it to Button-1.  We can do a
> quicky thing to allow it to ignore the event parameter:
[...]
> The above fix may not work perfectly yet.  If you're using a Python older
> than 2.2, you may need to do something to simulate lexical sope, perhaps
> something like this:
> 
> ###
> self.cboxDomain.component('entryfield_entry').bind('<Button-1>',
> lambda event,
> self=self: self.cboxDomain.invoke())
> ###

Danny, you're correct again!  I'll have to study up on lambdas.

This second method worked for me.  I'm using Python 2.1 for now.  I
assume that will continue to work in future versions of Python for a
while, too.  Is that correct?

Is there a mailing list somewhere that's dedicated to Python Tkinter
programming?

Thanks again!

--
Lance E Sloan
Web Services, Univ. of Michigan: Full-service Web and database design,
development, and hosting.  Specializing in Python & Perl CGIs.
http://websvcs.itd.umich.edu/ - "Putting U on the Web"