471,310 Members | 1,032 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

get mouse

I'm just trying to test and see if the get mouse statements are working
in my program. If they are, in the console window, it should go back to
the prompt. It doesn't for all of them, just the last
rectangle...sometimes. Am I setting them up correctly? here's the
relevant code...thx

The first two numbers are x1,x2 and the last two are y1, y2.

rectMathButton = CreateRect(4,6,7,8,"grey")
rectMathButton.draw(win)
rectScienceButton = CreateRect(3.5,6.5,5,6,"grey")
rectScienceButton.draw(win)
rectHistoryButton = CreateRect(3.5,6.5,3,4,"grey")
rectHistoryButton.draw(win)
rectGeographyButton = CreateRect(3.1,7,1,2,"grey")
rectGeographyButton.draw(win)

#math
p1 = win.getMouse()
while p1.getX()6 or p1.getX()< 4 or p1.getY()8 or p1.getY()< 7:
p1 = win.getMouse()

#science
p2 = win.getMouse()
while p2.getX()6.5 or p2.getX()< 3.5 or p2.getY()6 or p2.getY()<
5:
p2 = win.getMouse()

#history
p3 = win.getMouse()
while p3.getX()6.5 or p3.getX()< 3.5 or p3.getY()4 or p3.getY()<
3:
p3 = win.getMouse()

#geography
p4 = win.getMouse()
while p4.getX()7 or p4.getX()< 3.1 or p4.getY()2 or p4.getY()<
1.1:
p4 = win.getMouse()

Nov 27 '07 #1
0 1688

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Champaign | last post: by
9 posts views Thread by punkin | last post: by
3 posts views Thread by mitsura | last post: by
3 posts views Thread by Emjay | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.