Setting an event mask on a GnomeCanvasItem



I'm afraid I don't understand how I can use these functions to answer my
question. I though the grab functions were used to direct ALL events to
that ONE particular widget/canvasitem that is being grabbed. But I don't
want to do that. My canvas has 100 or so canvasitems scattered here and
there, and I just want to set an event mask on the events that _all_
those items will detect. In this case I want the canvasitems to just
detect button presses/releases. Could someone please clarify? Thanks.

On 31 Jan 2001 08:43:58 +0100, Frank Felfe wrote:
> Loban Rahman wrote:
> 
> > Question:
> > Is it possible to set an event mask on a GnomeCanvasItem? If so, how?
> > For any GtkWidget, I'd use the gtk_widget_set_events() function on it.
> > But GnomeCanvasItem derives directly from GtkObject. I tried using the
> > gtk_widget_set_events() function on the GnomeCanvas itself, but that
> > didn't work. For now I'm just manually filtering events myself by
> > checking the type field, but it's kludgy.
> 
> The gnome-canvas docs have 2 functions that should do what you want:
> 
> int         gnome_canvas_item_grab          (GnomeCanvasItem *item,
>                                                unsigned int event_mask,
>                                                GdkCursor *cursor,
>                                                guint32 etime);
> void        gnome_canvas_item_ungrab        (GnomeCanvasItem *item,
>                                                guint32 etime);
> 
> AFAIK GtkWidgets and CanvasItems don't share any properties, so
> GtkWidget-functions don't work on CanvasItems. CanvasItems implement
> their own functions.
> 
> Greetings
> FF
> 



-- 
/-------------------------------------------------------------------\
|   LOBAN AMAAN RAHMAN  <-- anagram of -->  AHA! AN ABNORMAL MAN!   |
|     loban earthling net, loban caltech edu, http://i.am/loban     |
\-------------------------------------------------------------------/





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