Python Forum
Error while changing button relief from raised to sunken on left click
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while changing button relief from raised to sunken on left click
#1
Hi,

I am trying to change the relief of a button from raised to sunken on left click. The button is created with a standard ttk.Button statement. In a custom theme, its relief has been modified to raised. It gets displayed perfectly. The code fragment for relief change is provided below.

button1.bind("<l>", lambda e: button1.configure(relief="sunken"))
Here is the error.
Error:
_tkinter.TclError: unknown option "-relief"
Version information: python 3.4.3, tkinter 8.6

I appreciate the cooperation of forum members.
Reply
#2
You could perhaps check this example
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter - touchscreen, push the button like click the mouse John64 5 849 Jan-06-2024, 03:45 PM
Last Post: deanhystad
  Figure Gets Larger Every time I click a show button joshuagreineder 2 1,329 Aug-11-2022, 06:25 AM
Last Post: chinky
  [Tkinter] changing and getting value through button niski1996 2 1,823 Aug-24-2021, 04:44 PM
Last Post: niski1996
  [Tkinter] Button error Tyrel 2 1,995 Jun-20-2021, 07:21 AM
Last Post: Tyrel
  [Tkinter] Modify Class on Button Click KDog 4 3,950 May-11-2021, 08:43 PM
Last Post: KDog
  [Tkinter] Button click problem using OOP JohnB 5 3,607 Oct-21-2020, 12:43 PM
Last Post: JohnB
  tkinter | Button color text on Click Maryan 2 3,371 Oct-09-2020, 08:56 PM
Last Post: Maryan
  [Tkinter] Trying to change font size w/o changing button size python63 3 9,853 Aug-05-2020, 01:04 AM
Last Post: Larz60+
  Closing window on button click not working kenwatts275 4 3,757 May-03-2020, 01:59 PM
Last Post: deanhystad
  [Tkinter] Checking button click in Tkinter GalaxyCoyote 3 7,363 Oct-20-2019, 03:28 AM
Last Post: GalaxyCoyote

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020