Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Gtk+/Gnome Application Development
Prev Home Next

The Mouse Pointer

The mouse pointer is represented on the screen by a small bitmap called the cursor. The cursor is normally an arrow shape, but it can be changed on a window-by-window basis. As the pointer moves, it generates motion events and moves the cursor on the screen to give the user feedback.

Pointer Location

You can query the pointer's location with gdk_window_get_pointer() (Figure 7). This function requests the X and Y coordinates of the pointer relative to the window passed as its first argument. It also requests the currently active modifiers (including modifier keys and buttons; this field is identical to the state field in several events, such as button events). If NULL is passed for the x, y, or state arguments, that argument will be ignored.

#include <gdk/gdk.h>

GdkWindow* gdk_window_get_pointer(GdkWindow* window, gint* x, gint* y, GdkModifierMask* state);

Figure 7. Querying Pointer Location

Gtk+/Gnome Application Development
Prev Home Next

 
 
  Published under free license. Design by Interspire