The problem is explained by the comments in the code. It is a fundamental question about the method call...every time I try text_box_name.tk_textBackspace() I get the TclError message. That's why I asked the question without the code...
# When user enters a search word in the +search_box' text widget and presses
# "Enter" on the keyboard, the search word is no longer visible because
# of the new line at the end of the string caused by pressing "enter".
# Hitting backspace on the keyboard brings the keyword back into view,
# so I tried to use the method tk_textBackspace to simulate that and remove
# the 'new line' (so the entry in list_box would again be visible.)
from tkinter import *
root = Tk()
# Keyword Search box (user inputs keywords)
search_box=Text(root, height=1,width=48, padx=5,wrap='word',
font=('helvetica','12','bold'))
search_box.insert(END,"Search box: Enter keywords and press 'Enter'")
# Keywords Search event handler.
def handle_event(event):
eventDict={'2':'KeyPress','3':'KeyRelease'}
if event.type=='2' and event.keysym=='Return' :
search_box.tk_textBackspace()
# the line above doesn't even get to execute...generates the error message:
# _tkinter.TclError: invalid command name "tk_textBackspace"
# but the library for text widget has that as a valid method...
# hence the question.
pass # the rest of the routine's code goes here
## the code below is my workaround (executes on "enter" key release)
## if event.type == '3' and event.keysym == 'Return':
## search_box.see(0.0) # Make start of Keywords string visible
## return
search_box.bind('<Key>',handle_event)
search_box.bind('<KeyRelease>', handle_event)
search_box.pack(fill='x', expand='yes',pady=2)
mainloop()