[gtkada] Canvas : Selected_Item Callback.

Clark, G L g.l.clark at lmco.com
Tue Mar 19 23:46:09 CET 2002


 I wrote a simple test application with a Gtkada.Canvas widget.  I basically
create a few canvas_items and put them on the canvas.  I've implemented no
handlers and only overloaded the Draw function to create the pixmaps.

 As expected when I left-click on an item nothing happens because no
handlers were implemented.  However, when I right-click on an item I still
get the error below printed to the console.  The program continues
execution.  So, if the problem is "somewhere in my code" then it would be
due to something that was not implemented rather than something implemented
incorrectly.
 
Gdk-CRITICAL **: file gdkevents.c: line 724 (gdk_event_free): assertion
`event != NULL' failed.

  According to the docs it seems there are two ways to go about implementing
a handler for selecting and manipulating items.
1.  Use the signal:
    "item_selected" 
	procedure Handler (Canvas : access Interactive_Canvas_Record'Class; 
				 Item : Canvas_Item);
    
2.  Overload On_Button_Click:
procedure On_Button_Click      
  (Item               : access Canvas_Item_Record;
   Event              :        Gdk.Event.Gdk_Event_Button);
-- Function called whenever the item was clicked on.

  In the program which cause me to write the original email I've not been
using On_Button_Click, I'm only catching the item_selected signal and
manipulating the Item from there.  Could this be the source of my problem?
If so, are there any examples of overloading On_Button_Click? Also are there
any examples of right clicking on a Canvas_Item?

  Thanks,
    George
 
-----Original Message-----
From: Emmanuel Briot [mailto:briot at ACT-Europe.FR]
Sent: Friday, March 15, 2002 3:16 AM
To: gtkada at lists.act-europe.fr
Subject: Re: [gtkada] Canvas : Selected_Item Callback.


"Clark, G L" <g.l.clark at lmco.com> writes:

>   I'm writing an application which uses a Gtkada.Canvas widget.  I have
> successfully implemented a handler for the Item_Selected signal.  When I
> click on an item with the left mouse button the event is handled
correctly.
> When I click on an item with the right mouse button I get:
[...]
>   Is this something which is not implemented in Gtkada.Canvas or am I
going
> about this the wrong way?


This works fine in GtkAda, the problem is somewhere in your code (or in the
interaction of your code with GtkAda).

Emmanuel

_______________________________________________
gtkada mailing list
gtkada at lists.act-europe.fr
http://lists.act-europe.fr/mailman/listinfo/gtkada




More information about the gtkada mailing list