# How to pass a member function to glfwSetMouseButtonCallback

**URL:** <https://discourse.glfw.org/t/how-to-pass-a-member-function-to-glfwsetmousebuttoncallback/541>\
**Category:** support\
**Created:** [April 10, 2014, 2:14am UTC](https://discourse.glfw.org/t/how-to-pass-a-member-function-to-glfwsetmousebuttoncallback/541 "2014-04-10T02:14:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 10, 2014, 2:14am UTC](https://discourse.glfw.org/t/how-to-pass-a-member-function-to-glfwsetmousebuttoncallback/541/1 "2014-04-10T02:14:51Z")

</div>

**[begre1929](https://sourceforge.net/u/begre1929/)** wrote on [Thursday, April 10, 2014](https://sourceforge.net/p/glfw/discussion/247562/thread/f9d54090/#66c5):

hi,  
I have a class,  
class Tomato{  
/…/  
public:  
Tomato(); // the constructor  
/_static?_/ void button(GLFWwindow\*,int,int,int);  
/…/  
}

in the constructor,  
Tomato::Tomato()  
{  
/…/  
glfwSetMouseButtonCallback(window, ??? );  
/…/  
}

where ??? means I failed so far to pass button. Could you tell me how to do that ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 10, 2014, 2:21am UTC](https://discourse.glfw.org/t/how-to-pass-a-member-function-to-glfwsetmousebuttoncallback/541/2 "2014-04-10T02:21:55Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, April 10, 2014](https://sourceforge.net/p/glfw/discussion/247562/thread/f9d54090/#fe59):

It’s in the FAQ.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [April 10, 2014, 2:56am UTC](https://discourse.glfw.org/t/how-to-pass-a-member-function-to-glfwsetmousebuttoncallback/541/3 "2014-04-10T02:56:02Z")

</div>

**[begre1929](https://sourceforge.net/u/begre1929/)** wrote on [Thursday, April 10, 2014](https://sourceforge.net/p/glfw/discussion/247562/thread/f9d54090/#3df9):

I see C… see you  
thx!
