Re: [GtkGLExt] how do I caption mouse motion events?



On 04.6.27 7:55 AM, "Peter" <pgaston siscom leavethisout net> wrote:

> Howdy,
> 
> I'm trying to get a very simple OpenGL application going in gtkmm.  I have
> experience with glut, and at this point I'm just trying to figure out how to
> do very simple things in gtk.  In fact, I started with the gtkglextmm gears
> demo on the web site, and gradually made changes putting in my drawing
> instead.  The next thing I need for porting our app from glut is to capture
> mouse motion on the gl drawing area and react accordingly.  I've tried
> overriding the on_motion_notify_event method for both the drawing area and
> the GtkWindow, but I can't seem to get that event to come through.  I can get
> other events, such as on_expose_event to come through obviously because I'm
> getting my drawing up on the screen.  Am I going after the wrong event or do
> I need to do more than just override on_motion_notify_event?
> 

You have to set event flags, e.g. Gdk::BUTTON1_MOTION_MASK, to the widget.
You can use Gtk::Widget::set_events() or Gtk::Widget::add_events().
shapes.c example comes with gtkglextmm source tarball is a good example.

Regards,
--Naofumi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]