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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f20243d2bfa19b04,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-22 07:27:18 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.213.112.26!newsfeed1.ulv.nextra.no!nextra.com!news1.oke.nextra.no.POSTED!not-for-mail From: "Frank" Newsgroups: comp.lang.ada Subject: change colors in GtkAda (Linux/GNAT 3-13p-7) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Message-ID: NNTP-Posting-Host: 130.67.136.139 X-Complaints-To: news-abuse@nextra.no NNTP-Posting-Date: Thu, 22 Nov 2001 16:27:17 MET Organization: Nextra Public Access X-Trace: readme.online.no 1006442837 130.67.136.139 Date: Thu, 22 Nov 2001 16:26:14 +0100 Xref: archiver1.google.com comp.lang.ada:16869 Date: 2001-11-22T16:26:14+01:00 List-Id: Hi! I have a little problem in GtkAda. I am trying to set a color before drawing a polygon, by rewriting a snippet of code from a Gtk textbook based in C:-) However the polygons is drawed in black. Is anyone able to see from this snippet of code, if I have used some wrong approach somewhere? The variabel My_Colormap is declared with Gdk.Color.Gdk_Colormap, My_Color with Gdk.Color.Gdk_Color and My_GC with Gdk.Gdk_GC. Frank ------------------------------------------------------------------- .... .. . . . . declare use Gdk.Color; use Gdk; Success : Boolean; begin if My_Colormap = null then My_Colormap := Gdk.Color.Get_System; Gdk.GC.Gdk_New(My_GC, Win); end if; Gdk.Color.Set_Rgb(My_Color, Gushort(10000), Gushort(0), Gushort(0)); Gdk.Color.Alloc_Color(My_Colormap, My_Color, False, True, Success); Gdk.GC.Set_Foreground(My_GC, My_Color); if not Success then Text_IO.Put_Line("error on alloc color"); end if; if Win = null then Text_IO.Put_Line("is null"); end if; end; Gdk.Drawable.Draw_Polygon ( Win, My_GC, True, Surface_Array);