Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8212641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:49:40+00:00 2026-06-07T10:49:40+00:00

My question is related to this one where a Text widget is used. However,

  • 0

My question is related to this one where a Text widget is used.

However, in my case I want to rebind the select all on the entry widget.

I tried the following which allows me to use Ctrl+w to select all input in the entry field:

self.frmSearch = Frame()
self.txtSearch = Entry(self.frmSearch, bd=1, width=35)
self.txtSearch.bind('<Control-w>',lambda e: self.txtSearch.select_range(0, END))

However, once I change Ctrl+w to Ctrl+a this does not work anymore and no text is selected. Does anyone have an explanation why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:49:44+00:00Added an answer on June 7, 2026 at 10:49 am

    It is because you are putting the binding on the widget rather than the widget class, and by default the bindings on the class fire after the bindings on the widget.

    The way Tkinter processes events is to first see if there is a binding on a widget, then on a class, and then on the toplevel window, and then finally on the special class “all”. The events are processed in order unless you break the chain of events, so to speak. So, your control-w binding happens, but then the binding on the class happens and effectively undoes what you you did in your binding.

    The best solution is to 1) not use lambda, but instead use a real method or function, and 2) do a “return ‘break'” which prevents the class and other bindings from firing. Or, if you want this binding to affect all entry widgets in your application rather than just a specific one, use bind_class giving the class name of 'Entry'.

    The question you refer to you in your question has an answer that gives an example of changing the class binding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question related to this one . I don't want to do
Another question related to this one . I have a List<SortableObjects> that is the
I have a question related to this one : I'm trying to attach an
This question is related to this one: Best way to store product colors in
Note: this question is related to this one , but two years is a
This question is related to the one I asked here . I'm trying to
This question is related somewhat to the one i asked HERE . Now, i
This question is related with one of my earlier questions.. Previous Post In there
This is a related question to one I posted earlier... I'm trying to sum
This is a related question to one I posted earlier today, I was initially

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.