12.7 An Improved Implementation
The solution to the problem outlined previously is valuable to understand because it will help you recognize the principles behind many professional graphics systems, including the TKinter graphics system used by Python. It also helps you understand what is happening in the graphics systems used in the Java programming language. Another benefit of the solution is that once you have the mechanism in place to solve the current problem, you will be able to implement a move method for all graphics objects very easily.
The solution to the problem begins with two additional instance variables for the GeometricObject class and one additional instance variable and one more method for the Canvas class. For the GeometricObject ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access