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 7984327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:14:06+00:00 2026-06-04T11:14:06+00:00

I am working with buttons in Tkinter, Python. The thing is when I click

  • 0

I am working with buttons in Tkinter, Python.

The thing is when I click in one button the text of the button shakes. It might be a default behavior for this widget and I don’t know how to disable it and make it static.

  • 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-04T11:14:07+00:00Added an answer on June 4, 2026 at 11:14 am

    I assume that you mean the relief change from raised to sunken when you click a button.

    This is what I found on http://wiki.tcl.tk/1048 (click ‘Show Discussion’ to see it):

    Unfortunately, the relief used when you click is hardcoded (as
    ‘sunken’), so you can’t configure it per-widget without hacking the Tk
    internals for the binding for buttons.

    So the simplest way around this would be to always make the button appear sunken

    MyButton = Tkinter.Button(
        self.frame, 
        text = "Foobar", 
        command = self.foobar, 
        relief=Tkinter.SUNKEN
    )
    

    The disadvantage of that is that it might make the button look unresponsive.

    You can also use a widget other than a button to be used as a clickable item (suggested by Joel Cornett). Here is a simple example with a label used as a button:

    import Tkinter
    
    class main:
            def __init__(self,root):
                    # make a label with some space around the text
                    self.lbl1 = Tkinter.Label(root,
                                              width = 16, height = 4,
                                              text = "Foobar")                
                    self.lbl1.pack()
    
                    # Call a function when lbl1 is clicked
                    # <Button-1> means a left mouse button click
                    self.lbl1.bind("<Button-1>", self.yadda)
                    self.lbl1.bind("<Enter>", self.green)
                    self.lbl1.bind("<Leave>", self.red)
    
            def yadda(self, event):
                    self.lbl1.config(text="Clicked!")
    
            def green(self, event):
                    self.lbl1.config(bg="green")
    
            def red(self,event):
                    self.lbl1.config(bg="red")
    
    if __name__ == "__main__":
        root = Tkinter.Tk()
        main(root)
        root.mainloop() 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a python based tkinter script, where the flow is like
I'm working on giving a python server a GUI with tkinter by passing the
Here are my buttons: <asp:Button ID=PreviousButton CssClass=previous-button button Text=Previous Visible=false OnClick=PreviousButton_Click runat=server /> <asp:Button
Currently I am working on one form which contains 2 buttons. Clicking on 1
My project was working fine, when suddenly the text on my buttons was being
Suppose I have the following Button made with Tkinter in Python: import Tkinter as
I'm using Python's Tkinter to create a GUI for a project i'm working on.
I am trying to display real-time text in Tkinter after a Button command calls
I'm working on a project using Tkinter and Python. In order to have native
I'm working on an iPhone app, and one of the buttons is supposed to

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.