Is it possible to draw a BUTTON?

Jason Benjamin hexusnexus at gmail.com
Wed Jul 27 17:51:25 EDT 2016


On Wed, 27 Jul 2016 13:18:16 -0700, huey.y.jiang wrote:

> Hi Folks,
> 
> It is common to put a BUTTON on a canvas by the means of coding.
> However, in my application, I need to draw a circle on canvas, and then
> make this circle to work as if it is a button. When the circle is
> clicked, it triggers a new image to be displayed. Somebody can help?
> Thanks!

It depends on what GUI toolkit you use.  Can you give more specific 
information?  

Since a canvas is refreshed (updated) every time the function for redraw 
is called, it is as simple as changing the variable for what should be 
drawn when a click event is sent to the canvas and the area hot-spot is 
the same as the area of the button.  Buffered drawing is similar. 



-- 
[The Computer] was the first machine man built that assisted the power of 
his brain instead of the strength of his arm. - Grace Hopper



More information about the Python-list mailing list