title: python pyglet on_mouse_press
body: <p>I'm trying to make a simple GUI using pyglet.</p>
  
  <p><strong>Here is my code:</strong></p>
  
  <pre><code>button_texture = pyglet.image.load('button.png')
  button = pyglet.sprite.Sprite(button_texture, x=135, y=window.height-65)
  
  def on_mouse_press(x, y, button, modifiers):
     if x &gt; button and x &lt; (button + button_texture.width):
        if y &gt; button and y &lt; (button + button_texture.height):
           run_program()
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/fiU7L.png" alt="enter image description here"></p>
  
  <p><strong>The problem</strong></p>
  
  <p>The "button.png" is displayed as the red box with "Click" inside. and is supposed to start run_program(). But currently the yellow in the bottom left is the place i have to click to initiate run_program(). </p>