[Tutor] Tkinter custom widgets

Phil phillor9 at gmail.com
Sun Feb 12 20:20:18 EST 2023


I've been investigating how I might create a custom widget class that 
contains a draw_circle method. Creating a draw_circle method is a 
straight forward task, however, positioning the resulting circle with 
.grid() seems to be logically impossible because the draw method 
requires a position.

I see that a custom widget class is a sub class of frame and further, 
the custom widgets are based on existing Tkinter widgets. Creating a 
widget from scratch seems to be a complex, if not impossible, task for 
the unskilled.

I'd like to postilion a button with the grid method and then position a 
custom widget circle in an adjacent cell. Maybe I could create a small 
canvas, or several small canvases, then draw the circle on a canvas and 
use grid() to position the canvas beside the button? It seems possible 
but messy.

-- 

Regards,
Phil



More information about the Tutor mailing list