# Rather noob-ish question, hope noone minds

**URL:** https://discourse.glfw.org/t/rather-noob-ish-question-hope-noone-minds/149
**Category:** support
**Created:** [June 30, 2004, 12:23pm UTC](https://discourse.glfw.org/t/rather-noob-ish-question-hope-noone-minds/149 "2004-06-30T12:23:10Z")
**Posts on this page:** 2
**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: [June 30, 2004, 12:23pm UTC](https://discourse.glfw.org/t/rather-noob-ish-question-hope-noone-minds/149/1 "2004-06-30T12:23:10Z")

</div>

**nobody** wrote on [Wednesday, June 30, 2004](https://sourceforge.net/p/glfw/discussion/247562/thread/b76682d2/#6b00):

Would someone mind showing an actual example about how to use the GFLWSetMousePosCallback? The example in the User’s Guide and the Reference aren’t helping me much, and I have a feeling once I see actual code I’ll understand. Thanks!

---

<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: [July 7, 2004, 8:10pm UTC](https://discourse.glfw.org/t/rather-noob-ish-question-hope-noone-minds/149/2 "2004-07-07T20:10:50Z")

</div>

**[marcus256](https://sourceforge.net/u/marcus256/)** wrote on [Wednesday, July 07, 2004](https://sourceforge.net/p/glfw/discussion/247562/thread/b76682d2/#6b00/7328):

void GLFWCALL mouseposfun( int x, int y )  
{  
&nbsp; printf("Mouse pos = %d,%d\n", x, y);  
}

int main(void)  
{  
&nbsp; glfwInit();  
&nbsp; glfwOpenWindow(100,100,8,8,8,0,0,0,GLFW\_WINDOW);  
&nbsp; glfwSetMousePosCallback(mouseposfun);  
&nbsp; do  
&nbsp; {  
&nbsp;&nbsp;&nbsp; glfwPollEvents();&nbsp; // \<- this is where mouseposfun is called  
&nbsp; }  
&nbsp; while( !glfwGetKey(GLFW\_KEY\_ESC) );  
&nbsp; glfwTerminate();  
}
