comp.lang.ada
 help / color / mirror / Atom feed
From: Srini - <rasikasrinivasan@gmail.com>
Subject: Re: GTKAda drawing
Date: Fri, 9 Oct 2009 01:50:13 -0700 (PDT)
Date: 2009-10-09T01:50:13-07:00	[thread overview]
Message-ID: <c7f4ac41-3fac-4756-83a4-0f3fcc780e66@c3g2000yqd.googlegroups.com> (raw)
In-Reply-To: ddc71397-eb9d-4b20-8ddf-815ba38e3f3a@d23g2000vbm.googlegroups.com

On Oct 8, 6:55 pm, "RasikaSriniva...@gmail.com"
<rasikasriniva...@gmail.com> wrote:
> 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

found the answer. I need to use  Set_Rgb_Fg_Color instead of
Set_Foreground. srini



      reply	other threads:[~2009-10-09  8:50 UTC|newest]

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

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