[gtkada] Canvas Item Record

Clark, G L g.l.clark at lmco.com
Fri Mar 8 21:30:23 CET 2002


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




More information about the gtkada mailing list