Re: GtkDrawingArea on_clicked ?



2005/11/28, Chris Vine <chris cvine freeserve co uk>:
> On Monday 28 November 2005 02:52, Rob Benton wrote:
> > Jonathon Jongsma wrote:
> > > You might try looking at the function Gtk::Widget::set_events() or
> > > Gtk::Widget::add_events() to make the drawing area respond to the
> > > events you're interested in.
> > >
> > > jonathon
> > >
> > > On 11/26/05, congo imafexbb sk <congo imafexbb sk> wrote:
> > >>Hi,
> > >>  i've got drawinrgarea and i'm trying  to make something when i click
> > >>with mouse on it but my tries failed. Can some give me a clue how to do
> > >>it ?
> >
> > Use a Gtk::EventBox.  Check the book in the Gtkmm documentation, chapter
> > 12.
>
> You don't need an EventBox if you have a DrawingArea as I am pretty sure it
> has its own Gdk::Window (that is one of its purposes).  If so, it is already
> capable of receiving events - you just need to enable them with
> Gtk::Widget::set_events().
>
> Chris
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>

I succed to do it like this :


class MyArea : public Gtk::DrawingArea
{
...
}

MyArea::MyArea()
{
...
  this->add_events(Gdk::ALL_EVENTS_MASK );
...
}



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