I have an array of rectangles (days of month) next to each other. I want the user to be able to drag with the mouse down over the array and select (fillcolor) the boxes that are touched.
Unfortunately, I can’t make that happen. I’ve put ‘Return True’ in the mouse down event but mousedrag fires only for the first rectangle the cursor is on, not the next (rectangles ara a control set). Anybody?
@Alexander van der Linden The easiest way would certainly be to add an empty Canvas on top of all the rectangles and handle all the mouse events from it.
or…
No canvas at all.
This all works fine straight onto a window.
The words and letters are .drawstring
The boxes are .fillrect
You know which boxes are being passed over based on
( Y co-ordinate minus top of first row) / (Row height including the space)
and
( X co-ordinate minus left of leftmost square) / ( width of square plus space)