|
-
January 24th, 2013, 06:12 AM
#4
Re: 'const' member functions
 Originally Posted by John E
The problem now is that having succesfully obtained the pointer, I can't use it !!!
My ultimate aim is to find the 'x' and 'y' co-ordinates for this window's mouse pointer:-
Code:
void functionB() const
{
gint x, y;
Gdk::ModifierType state;
Glib::RefPtr<const Gdk::Window> p = canvas_event_box.get_window();
p->get_pointer (x, y, state);
}
But the red line now gives me this error
If get_pointer() is non-const, then again, you're trying to call a non-const member function on a const object. That isn't going to work.
You need to go through the public interface of whatever Gdk::Window is, and identify which functions are const, which are non-const, and use the appropriate function.
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|