#!/usr/bin/env python3
# -*- config: utf-8 -*-

from tkinter import *

root = Tk()
c = Canvas(width=200, height=200,
           bg='white')
c.pack()

rect = c.create_rectangle(
    80, 80, 120, 120, fill='lightgreen')


def in_focus(event):
    c.itemconfig(rect, fill='green', width=2)
    c.coords(rect, 70, 70, 130, 130)


c.bind('<FocusIn>', in_focus)

root.mainloop()

00e84a527ddeb6d42aa7770a0ec798002629200e
<mask token>


def in_focus(event):
    c.itemconfig(rect, fill='green', width=2)
    c.coords(rect, 70, 70, 130, 130)


<mask token>

<mask token>
c.pack()
<mask token>


def in_focus(event):
    c.itemconfig(rect, fill='green', width=2)
    c.coords(rect, 70, 70, 130, 130)


c.bind('<FocusIn>', in_focus)
root.mainloop()

<mask token>
root = Tk()
c = Canvas(width=200, height=200, bg='white')
c.pack()
rect = c.create_rectangle(80, 80, 120, 120, fill='lightgreen')


def in_focus(event):
    c.itemconfig(rect, fill='green', width=2)
    c.coords(rect, 70, 70, 130, 130)


c.bind('<FocusIn>', in_focus)
root.mainloop()

from tkinter import *
root = Tk()
c = Canvas(width=200, height=200, bg='white')
c.pack()
rect = c.create_rectangle(80, 80, 120, 120, fill='lightgreen')


def in_focus(event):
    c.itemconfig(rect, fill='green', width=2)
    c.coords(rect, 70, 70, 130, 130)


c.bind('<FocusIn>', in_focus)
root.mainloop()

#!/usr/bin/env python3
# -*- config: utf-8 -*-

from tkinter import *

root = Tk()
c = Canvas(width=200, height=200,
           bg='white')
c.pack()

rect = c.create_rectangle(
    80, 80, 120, 120, fill='lightgreen')


def in_focus(event):
    c.itemconfig(rect, fill='green', width=2)
    c.coords(rect, 70, 70, 130, 130)


c.bind('<FocusIn>', in_focus)

root.mainloop()
