0

I am using easygui multenterbox so as to give users the option to edit specific information out of data being copied. My only problem is that pressing 'backspace' results in '\b' being added to the string instead of erasing a character. Has anybody figured out a way to add a <backspace> event to the field within the multenterbox?
I have used this event in the past on tkinter "Entry" and "Text".

sample code:

msg         = "Enter name"
            title       = "New name"
            fieldName  = ['name']


            newTitle= 'NewName'

            fieldValue = [newName]  
            fieldValue = multenterbox(msg,title, fieldName,fieldValue)

            # make sure that none of the fields were left blank
            while 1:  # do forever, until we find acceptable values and break out
                if fieldValue == None: 
                    break
                errmsg = ""
                # look for errors in the returned values
                for i in range(len(fieldName)):
                    if fieldValue[i].strip() == "":
                        errmsg = errmsg + '"{}" is a required field.\n\n'.format(fieldName[i])
                if errmsg == "": 
                    # no problems found
                    print ("Reply was:", fieldValue)
                    break 
                else:
                    # show the box again, with the errmsg as the message    
                    fieldValue = multenterbox(errmsg, title, fieldName, fieldValue)

The above code snippet is showing the functionality that I already have, and works. My program will open a multenterbox window with the value of NewTitle which could be edited by the user. How do I control the editable entry in the multenterbox so that it supports backspace?

Thanks, MMH

MMH
  • 1
  • 2
  • I tried this code and needed to make a minor change: fieldValue = [newName] to fieldValue = [newTitle]. After that, on my Windows machine, Backspace worked fine, but the arrow keys moved from widget to widget. is that what you are seeing, or does the backspace indeed not work? – Robert Lugg Dec 17 '14 at 06:08
  • I'm using it on linux/ centos 5, backspace just doesn't work. – MMH Dec 17 '14 at 09:56
  • Since I couldn't find sufficient support, I created my own multenterbox from scratch. Thanks for the effort. – MMH Dec 17 '14 at 10:44

0 Answers0