Is it possible to draw a BUTTON?

Rick Johnson rantingrickjohnson at gmail.com
Mon Aug 1 19:28:39 EDT 2016


On Thursday, July 28, 2016 at 11:32:19 PM UTC-5, huey.y... at gmail.com wrote:
> Yes, Rick's code works great. Well, could you go a little
> further?

No, i think we've gone far enough. Just FYI, Rick doesn't do
homework for free *OR* for a fee. Now, it's time for *YOU*
to step u.! If you want more help, you'll first have to
prove that our offerings so far have not fallen on deaf ears.

Here are two indispensable sites for learning Tkinter:

  http://effbot.org/tkinterbook/
  
  http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/index.html

I will not write the code for you, but i will give you a
basic outline to follow.

  (Step 1): Learn how to display an image on the Tkinter
  canvas.

  (Step 2): In the handler that is bound to the mouse press
  event, display the image where ever you want.

  Note: If you want the image to be displayed whilst the
  mouse button is held down, and then hidden when the mouse
  button is released, you'll have to bind the events
  "<Button-N>" for the press, and <ButtonRelease-N> for the
  release -- where "N" is the number 1,2 or 3. Look at
  Christian's code for more details.

PS: If you're having trouble, please don't expect us to
solve multiple problems at once, instead, try to focus on
one step of the problem at a time. If you're going to be a
programmer, learning to break down large complex problems
into smaller, more manageable chunks, will be paramount to
your success. After you get all the "chunks" working, then
you can assemble them into a working program. Since the
interpreted nature of Python allows you to easily test small
"chunks of code" on the command line and see the results, be
sure to take advantage of this ability!



More information about the Python-list mailing list