[gtkada] Canvas : Selected_Item Callback.

Clark, G L g.l.clark at lmco.com
Fri Mar 15 00:04:54 CET 2002


  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:

Gdk-CRITICAL **: file gdkevents.c: line 724 (gdk_event_free): assertion
`event != NULL' failed.

  I would like to be able to click on an item with the right mouse button
and have a pop-up menu appear.  

  Is this something which is not implemented in Gtkada.Canvas or am I going
about this the wrong way?

   Thanks,
      George Clark

-----Original Message-----
From: Clark, G L [mailto:g.l.clark at lmco.com]
Sent: Friday, March 08, 2002 2:30 PM
To: 'gtkada at lists.act-europe.fr'
Subject: [gtkada] Canvas Item Record


Hello All,

  I'm trying to implement a handler for the "item_selected" signal in the
GtkAda.Canvas widget.
  My first approach which I thought would be the most simple is a general
handler using Gtk_Args.  Now I need to get the parameter from Params and
convert it into a Canvas_Item and I have no idea how to go about this.  I'm
hoping not to need to write my own Marshallers and such, I'd like to keep
this as simple as possible.  Is there something obvious I'm missing about
Gtk_Args?
  Any help would be appreciated.

  George Clark


   procedure On_Workarea1_Item_Selected_Event
     (Object : access Gtk_Widget_Record'Class;
      Params : Gtk.Arguments.Gtk_Args)
   is
     -- Arg1 : Gtkada.Canvas.Canvas_Item := ???(Params, 1);
   begin
      Text_IO.Put_Line("In Item Selected Event");
      --Manipulate Canvas Item here.
   end On_Workarea1_Item_Selected_Event;

 

-----Original Message-----
From: Emmanuel Briot [mailto:briot at ACT-Europe.FR]
Sent: Monday, March 04, 2002 4:48 AM
To: gtkada at lists.act-europe.fr
Subject: Re: [gtkada] Canvas Item Record


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

>     I have several types of canvas_item_records,  an arc, a rectangle, and
> an alphanumeric.  They each are derived from canvas_iterm_record and each
> have an overloaded Draw function.  In each draw function I use methods
from
> Gtk_Drawable to create the appropriate pixmaps.  'Draw_Rectangle,
Draw_Arc,
> Draw_Text.
>     I then create an item of each type and 'Put' them onto the Canvas.  As
> expected a can drag around the rectangle pixmap and the Arc pixmap.
> However, I can't drag around the Text on the Canvas.  Is this expected
> behavior or am I doing something wrong?

I don't think this is an expected behavior, but it would be nice to have
some
source code to check what you are doing. You might want to create a
double-buffer item, with its own pixmap (sorry, I don't remember exactly if
this was already doable with the last public release of GtkAda, or if this
was
only added in the development version since then).


>    I think this post is appropriate for this group because of differences
> between the Gnome Canvas widget and the one provided with GtkAda.

Indeed, the GtkAda canvas is specific to GtkAda, and doesn't exist with
gtk+. The Gnome canvas hasn't been fully bound yet.

regards,
Emmanuel

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

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




More information about the gtkada mailing list