comp.lang.ada
 help / color / mirror / Atom feed
From: "RasikaSrinivasan@gmail.com" <rasikasrinivasan@gmail.com>
Subject: GTKAda drawing
Date: Thu, 8 Oct 2009 15:55:50 -0700 (PDT)
Date: 2009-10-08T15:55:50-07:00	[thread overview]
Message-ID: <ddc71397-eb9d-4b20-8ddf-815ba38e3f3a@d23g2000vbm.googlegroups.com> (raw)

This I suspect could be a GtkAda related question:

I have this handler to paint.

   Currentcolor : Gdk.Color.Gdk_Color ;

   function Canvas_Paint(canvas : access
Gtk.Drawing_Area.Gtk_Drawing_Area_Record'Class) return Boolean  is
      Drawwin : Gdk.Window.Gdk_Window ;
      Gc : Gdk.Gc.Gdk_gc ;

   begin
      pragma Debug(Put_Line("Repaint canvas"));
      Drawwin := Canvas.Get_Window ;
      Gdk.Gc.Gdk_New(Gc,drawwin) ;
      Gdk.Gc.Set_foreground(Gc,Currentcolor) ;
      pragma Debug(Showcurrentcolor);
      Newx := Newx + 10 ;
      Newy := Newy + 10 ;
      Gdk.Gc.Set_Line_Attributes( Gc , 5 , Gdk.Gc.Line_Solid ,
Gdk.Gc.Cap_Butt , Gdk.gc.Join_Round ) ;
      Gdk.drawable.Draw_Line( Drawwin , Gc , newx , newy , 100 ,
100) ;
      return True;
   end Canvas_Paint ;

whatever be the "currentcolor" my line is always of the same color.
Perhaps this is not the way to choose the color of the pen to draw the
line (and other figures).

thanks for pointers.

srini



             reply	other threads:[~2009-10-08 22:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08 22:55 RasikaSrinivasan@gmail.com [this message]
2009-10-09  8:50 ` GTKAda drawing Srini -
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox