Skip to content

Commit

Permalink
fix reference method call to widget name instead of object israel-dry…
Browse files Browse the repository at this point in the history
  • Loading branch information
israel-dryer committed Jul 10, 2022
1 parent b5c87fc commit bf7a841
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/ttkbootstrap/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,22 @@ def apply_class_bindings(window: tkinter.Widget):
className=className,
sequence="<Configure>",
func=on_disabled_readonly_state,
add="+"
)
add="+")

for sequence in ["<Control-a>", "<Control-A>"]:
window.bind_class(
className=className,
sequence=sequence,
func=on_select_all
)
func=on_select_all)

window.unbind_class("TButton", "<Key-space>")
window.bind_class("TButton", "<Key-Return>", lambda event: event.widget.invoke())

def on_button_enter(event):
widget = window.nametowidget(event.widget)
widget.invoke()

window.bind_class("TButton", "<Key-Return>", on_button_enter)
window.bind_class("TButton", "<KP_Enter>", on_button_enter)


def apply_all_bindings(window: tkinter.Widget):
Expand Down

0 comments on commit bf7a841

Please sign in to comment.