From: "ldries46" <bertus.dries@planet.nl>
Subject: Re: GTK 3.8 Graphic programming
Date: Sun, 5 Jan 2014 08:43:58 +0100
Date: 2014-01-05T08:43:58+01:00 [thread overview]
Message-ID: <52c90da6$0$13838$703f8584@textnews.kpn.nl> (raw)
In-Reply-To: <52c69509$0$22518$703f8584@news.kpn.nl>
In the meantime I isolated the problem. Setting a breakpoint before I call
Gtk.Main.Main I can see then grid I am drawing, the moment I start again the
drawing disappears.
The problem seems to be that the position where I must create a starting
grid that is necessary before any further action in the program should be
taken. How can I do such a thing.
"ldries46" schreef in bericht news:52c69509$0$22518$703f8584@news.kpn.nl...
I am trying to learn myself simple graphical programming in GTK 3.8
(GtkAda).
I want to draw a a simple grid in a drawing area.
With Glade 3 I created a window with a GtkdrawingArea with in a GtkViewport
with in a GtkScrolledWindow
within a GtkVBox within a GtkWindow. So far the program works.
With Get_Object the GtkdrawingArea was extracted from the builder and used
to create a Cairo context C
Now I want to draw a grid using
Gdkw := Get_Window (Gtk_Drawing_Area);
CR := Create(Gdkw);
Save(CR);
Set_Source_Rgb(CR, 1.0, 0.0, 0.0);
Paint(CR);
Restore(CR);
Number := Width * Height;
Total_W := Init_W + W * W * CW;
Total_H := Init_H + H * H * CW;
Set_Line_Width(CR, 3.0);
Set_Source_Rgb(CR, 1.0, 1.0, 1.0);
for n in 0.. H * H loop
Move_To(CR, GDouble(Init_W + n * CW), GDouble(Init_H));
Rel_Line_To(CR, GDouble(Total_W), 0.0);
Stroke(CR);
end loop;
for n in 0.. W * W loop
Move_To(CR, GDouble(Init_W), GDouble(Init_H + n * CW));
Rel_Line_To(CR, 0.0, GDouble(Total_H));
Stroke(CR);
end loop;
The result is still an empty drawing area. The back round is still white
(Should be red) the lines are invisisble
I still am missing something.
I tried to find Ada examples how to create a running program but I cannot
find anything.
Who can help either by directing me to Ada examples or by telling me what I
do miss in this program
next prev parent reply other threads:[~2014-01-05 7:43 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-03 10:44 GTK 3.8 Graphic programming ldries46
2014-01-05 7:43 ` ldries46 [this message]
2014-01-05 9:12 ` Dmitry A. Kazakov
2014-01-05 16:45 ` ldries46
2014-01-05 18:10 ` Dmitry A. Kazakov
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox