Re: Gtk::DrawingArea with Cairomm from Glade - no Event
- From: Lyle Underwood <lyleunderwood gmail com>
- To: gtkmm-list <gtkmm-list gnome org>
- Subject: Re: Gtk::DrawingArea with Cairomm from Glade - no Event
- Date: Thu, 28 Jan 2010 11:27:32 -0800
set_events basically does currentEventMask = newEventMask, whereas
add_events basically does currentEventMask |= newEventMask. I'm pretty
sure there are some low-level events in there by default that do
SOMETHING. Like STRUCTURE and stuff, I don't even know.
On Thu, 2010-01-28 at 20:16 +0100, Andreas Volz wrote:
> Am Thu, 28 Jan 2010 10:45:14 -0800 schrieb Lyle Underwood:
>
> Hello Lyle,
>
> thanks for this hint. It works nice nice. From the docs I really don't
> see the difference between add_events and set_events...
>
> regards
> Andreas
>
> > You don't need an event box. I inherited from Gtk::DrawingArea and put
> > this in the constructor:
> >
> > this->add_events(Gdk::POINTER_MOTION_MASK
> > | Gdk::POINTER_MOTION_HINT_MASK
> > | Gdk::BUTTON_PRESS_MASK
> > | Gdk::LEAVE_NOTIFY_MASK);
> >
> > Obviously I wanted to track the pointer motion as well ( for my
> > rudimentary drawing app ). Also, make sure your DrawingArea is
> > sensitive.
> >
> > On Thu, 2010-01-28 at 19:24 +0100, Andreas Volz wrote:
> > > Hello,
> > >
> > > I placed a Gtk::DrawingArea in Glade and realized it with cairomm.
> > > All drawing on this surface works, but I get only expose events.
> > > Even if I overwrite the on_event() functions I see not any more
> > > events. I'm interested in the mouse button/position events. My
> > > first idea was to use
> > >
> > > set_events (Gdk::EXPOSURE_MASK | Gdk::BUTTON_PRESS_MASK |
> > > Gdk::BUTTON_RELEASE_MASK);
> > >
> > > but this results in:
> > >
> > > (state:15062): Gtk-CRITICAL **: gtk_widget_set_events: assertion
> > > `!GTK_WIDGET_REALIZED (widget)' failed
> > >
> > > Do I have to place my Gtk::DrawingArea in a Gtk::EventBox o catch my
> > > mouse events? Any other hints?
> > >
> > > regards
> > > Andreas
> > > _______________________________________________
> > > gtkmm-list mailing list
> > > gtkmm-list gnome org
> > > http://mail.gnome.org/mailman/listinfo/gtkmm-list
> >
> >
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]