comp.lang.ada
 help / color / mirror / Atom feed
* GTK 3.8 Graphic programming
@ 2014-01-03 10:44 ldries46
  2014-01-05  7:43 ` ldries46
  0 siblings, 1 reply; 5+ messages in thread
From: ldries46 @ 2014-01-03 10:44 UTC (permalink / raw)


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 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-05 18:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03 10:44 GTK 3.8 Graphic programming ldries46
2014-01-05  7:43 ` ldries46
2014-01-05  9:12   ` Dmitry A. Kazakov
2014-01-05 16:45     ` ldries46
2014-01-05 18:10       ` Dmitry A. Kazakov

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