[Tutor] disabling Pmw ComboBox's EntryField?

lsloan@umich.edu lsloan@umich.edu
Fri, 15 Feb 2002 11:25:06 -0500


How do I disable a Pmw ComboBox's EntryField and make its dropdown menu
open when that EntryField is clicked?

What I've tried in my class so far is:

	self.cboxDomain = Pmw.ComboBox(grpNav.interior(),
		label_text='Domain:',
		labelpos='w',
		fliparrow=1,
		selectioncommand=self.clickDomain)
	self.cboxDomain.component('entryfield_entry').bind('<Button-1>',
		self.cboxDomain.invoke)
	self.cboxDomain.component('entryfield_entry').configure(
		state=DISABLED)
	self.cboxDomain.grid(row=1, column=0, columnspan=2, sticky='w')

The disabling part works fine.  I can't type anything into the field,
yet when I select something from the dropdown menu, it will appear in
it, which is what I wanted.  However, the initial click on the
EntryField produces this error:

	Error: 1
	TypeError Exception in Tk callback
	  Function: <method ComboBox.invoke of ComboBox instance at
	  4adb64> (type: <type 'instance method'>)
	  Args: (<Tkinter.Event instance at 578744>,)
	  Event type: ButtonPress (type num: 4)
	Traceback (innermost last):
	  File ".../Pmw/Pmw_0_8_5/lib/PmwBase.py", line 1690, in
	  __call__
		None
	TypeError: too many arguments; expected 1, got 2

--
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"