From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,189c592184c1580e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!c3g2000yqd.googlegroups.com!not-for-mail From: Srini - Newsgroups: comp.lang.ada Subject: Re: GTKAda drawing Date: Fri, 9 Oct 2009 01:50:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 98.216.109.119 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1255078213 4740 127.0.0.1 (9 Oct 2009 08:50:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 9 Oct 2009 08:50:13 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c3g2000yqd.googlegroups.com; posting-host=98.216.109.119; posting-account=mZyFSQoAAABfOmklsh1d8TPbS2LncUKl User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:8633 Date: 2009-10-09T01:50:13-07:00 List-Id: On Oct 8, 6:55=A0pm, "RasikaSriniva...@gmail.com" wrote: > This I suspect could be a GtkAda related question: > > I have this handler to paint. > > =A0 =A0Currentcolor : Gdk.Color.Gdk_Color ; > > =A0 =A0function Canvas_Paint(canvas : access > Gtk.Drawing_Area.Gtk_Drawing_Area_Record'Class) return Boolean =A0is > =A0 =A0 =A0 Drawwin : Gdk.Window.Gdk_Window ; > =A0 =A0 =A0 Gc : Gdk.Gc.Gdk_gc ; > > =A0 =A0begin > =A0 =A0 =A0 pragma Debug(Put_Line("Repaint canvas")); > =A0 =A0 =A0 Drawwin :=3D Canvas.Get_Window ; > =A0 =A0 =A0 Gdk.Gc.Gdk_New(Gc,drawwin) ; > =A0 =A0 =A0 Gdk.Gc.Set_foreground(Gc,Currentcolor) ; > =A0 =A0 =A0 pragma Debug(Showcurrentcolor); > =A0 =A0 =A0 Newx :=3D Newx + 10 ; > =A0 =A0 =A0 Newy :=3D Newy + 10 ; > =A0 =A0 =A0 Gdk.Gc.Set_Line_Attributes( Gc , 5 , Gdk.Gc.Line_Solid , > Gdk.Gc.Cap_Butt , Gdk.gc.Join_Round ) ; > =A0 =A0 =A0 Gdk.drawable.Draw_Line( Drawwin , Gc , newx , newy , 100 , > 100) ; > =A0 =A0 =A0 return True; > =A0 =A0end 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