From: "Frank" <franjoe@frisurf.no>
Subject: change colors in GtkAda (Linux/GNAT 3-13p-7)
Date: Thu, 22 Nov 2001 16:26:14 +0100
Date: 2001-11-22T16:26:14+01:00 [thread overview]
Message-ID: <pP8L7.2696$Yn3.50706@news1.oke.nextra.no> (raw)
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);
next reply other threads:[~2001-11-22 15:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-22 15:26 Frank [this message]
2001-11-22 15:57 ` change colors in GtkAda (Linux/GNAT 3-13p-7) Preben Randhol
2001-11-22 16:12 ` Frank
2001-11-23 13:48 ` Jacob Sparre Andersen
2001-11-23 14:31 ` Preben Randhol
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox