Multi-page window cannot highlight Entry text with callback Multi-page window cannot highlight Entry text with callback tkinter tkinter

Multi-page window cannot highlight Entry text with callback


Well, this has been a productive question. If anyone in the future is doing something similar to this and needs a reference for how to solve the problem:

I was able to work around the problem by forcing the Entry widgets into focus every time I switch frames, and using the return "break" statement that I mention in the question's update.

This isn't ideal, as every time a page is changed you automatically focus on the Entry widget, but once the widget is in focus it's behavior is exactly what I would expect so this isn't of great concern. In my program, if you are changing pages it is quite likely you will use the Entry widget anyway (it is a search entry).

Here's the final changes required to make the code work correctly:

# .... some code ....    self.f1.lift()    self.e1.focus_force()def page(self, val):    self.b1.config(relief = RAISED)    self.b2.config(relief = RAISED)    if val == 1:        self.f1.lift()        self.b1.config(relief = SUNKEN)        self.e1.focus_force()    else:        self.f2.lift()        self.b2.config(relief = SUNKEN)        self.e2.focus_force()def event(self, widget):     widget.select_range(0, END)    return "break"# .... more code ....