Skip to content

root.focus_get() dont detect if the focus is on custom tkinter entrys . #610

@VermillionDev

Description

@VermillionDev
import customtkinter
from tkinter import *


def test(event):
    if root.focus_get() == custom_entry:
        print("custom_entry")
    elif root.focus_get() == ttk_entry:
        print("ttk_entry")


root = customtkinter.CTk()

custom_entry = customtkinter.CTkEntry(root)   #CTkEntry
custom_entry.pack()

ttk_entry = Entry(root)                       #ttk_entry
ttk_entry.pack()

root.bind("<Return>", test)
root.mainloop()

when I click on the ttk entry and press enter it print ----> "ttk_entry"

But when I do the same thing to the customtkinter.CTkEntry it print nothing .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions