[gtkada] Gtk-extra-plot, Draw_Line

tino13 at web.de tino13 at web.de
Tue Oct 12 17:45:59 CEST 2004


Hello,

i'm trying to draw a line on an existing plot. 
Programming language is ada95 and the OS is Red Hat Linux.

The plot was simply created with Gtk_New(). as mentioned before i tried to draw a line with the 
procedure:

   procedure Draw_Line (Plot : access Gtk_Plot_Record;
                        Line : Gtk_Plot_Line;
                        X1, Y1, X2, Y2 : Gdouble);

defined in gtk-extra-plot.ads .

the problem is the Gtk_Plot_Line. I have no clue how to define that. When you follow the type, than at the end you get a type C_Dummy.

so i thought  to declare a dummy line like

Dummy_line : Gtk_Plot_Line;

but surprise, there was no line plotted. than i thought ok , lets change the attribute with   

procedure Set_Line_Style (Line : Gtk_Plot_Line; Style : Plot_Line_Style);
   --  Change the style of the line.

   procedure Set_Line_Width (Line : Gtk_Plot_Line; Width : Gfloat);
   --  Change the width of the line.

   procedure Set_Color (Line : Gtk_Plot_Line; Color : Gdk.Color.Gdk_Color);
   --  Change the color used to draw the line

but the result was a crash and a storage error. I hope somebody can tell me how to use this command.
thanks.
cheers
martin





More information about the gtkada mailing list