Menu

#19 glutMouseFunc handler button arg

v2.0
closed-invalid
GLUT (25)
5
2001-09-09
2001-09-09
No

A handler defined on a modified version of the
"simple" demo:

def on_mouse(self, button, state, x, y):
print (button, state, x, y)

when used via glutMouseFunc(self.on_mouse) the button
arg is always 0, the others are what is expected.
That is, I get output like:

(0, 0, 198, 203)
(0, 1, 114, 262)
(0, 0, 137, 43)
(0, 1, 207, 105)
(0, 0, 168, 30)
(0, 1, 162, 240)
(0, 0, 263, 220)
(0, 1, 87, 130)
(0, 0, 149, 230)
(0, 1, 157, 88)

I'm new to GL, so my apologies if I'm missing an
additional initialisation or handler step.

Discussion

  • Tarn Weisner Burton

    Logged In: YES
    user_id=21784

    Try out this test script. Works on my system. If it
    doesn't work on your system upload PyOpenGL_info.html
    produced by OpenGL/scripts/info.py

     
  • Tarn Weisner Burton

     
  • Richard Jones

    Richard Jones - 2001-09-09

    Logged In: YES
    user_id=6405

    That test script didn't work - PyOpenGL_info.html attached.

     
  • Richard Jones

    Richard Jones - 2001-09-09
     
  • Tarn Weisner Burton

    Logged In: YES
    user_id=21784

    Tested on Win32 and Linux (RedHat). Works fine. The
    C code used to interface to glutMouseFunc and the
    callback is trivial, i.e. just passes the arguments
    straight through.

    Try this C program so we can determine if its' a
    PyOpenGL problem. This will probably work to compile

    gcc -o test test.c -lglut -lGL -lGLU

     
  • Tarn Weisner Burton

     
  • Richard Jones

    Richard Jones - 2001-09-09

    Logged In: YES
    user_id=6405

    *sigh*

    Sorry, my mistake.

     
  • Richard Jones

    Richard Jones - 2001-09-09
    • status: open --> closed-invalid
     
  • Tarn Weisner Burton

    Logged In: YES
    user_id=21784

    no prob

     

Log in to post a comment.