How to use Gdk::POINTER_MOTION_HINT_MASK?
- From: Robert Hildebrandt <roberts_katz gmx de>
- To: gtkmm-list gnome org
- Subject: How to use Gdk::POINTER_MOTION_HINT_MASK?
- Date: Sun, 06 Sep 2009 21:55:56 +0200
Hi,
I want to use the POINTER_MOTION_HINT_MASK Events within a DrawingArea.
But it sends every time I move the mouse an event, as if it was a
POINTER_MOTION_MASK Event. The only difference is, that event->is_hint
is true.
Here's the Code:
#include <gtkmm.h>
#include <iostream>
struct MainWindow : public Gtk::Window
{
Gtk::DrawingArea draw;
MainWindow()
{
add(draw);
draw.show();
draw.add_events(Gdk::POINTER_MOTION_HINT_MASK |
Gdk::POINTER_MOTION_MASK);
draw.signal_motion_notify_event().connect(sigc::ptr_fun(&MainWindow::on_move));
}
static bool on_move(GdkEventMotion* event)
{
if(event->is_hint)
{
std::cout<<"IS HINT\n"; // this is shown on the Console, every
time I move the cursor
}else
{
std::cout<<"IS NOT HINT\n";
}
return true;
}
};
int main(int argc, char** argv)
{
Gtk::Main main(argc, argv);
MainWindow w;
main.run(w);
return 0;
}
Thank you in advance
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]