0

easygui multenterboxコピー中のデータから特定の情報を編集するオプションをユーザーに提供するために使用しています。私の唯一の問題は、「バックスペース」を押すと、文字が消去される代わりに「\b」が文字列に追加されることです。<backspace>マルチエンターボックス内のフィールドにイベントを追加する方法を見つけた人はいますか?
私は過去にtkinterの「エントリー」と「テキスト」でこのイベントを使用しました。

サンプルコード:

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)

上記のコード スニペットは、私が既に持っていて動作する機能を示しています。私のプログラムは、ユーザーが編集できる NewTitle の値を持つ multenterbox ウィンドウを開きます。バックスペースをサポートするように multienterbox の編集可能なエントリを制御するにはどうすればよいですか?

ありがとう、MMH

4

0 に答える 0