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.3 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE, STOX_REPLY_TYPE_WITHOUT_QUOTES,XPRIO autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!backlog3.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!news.panservice.it!feed.xsnews.nl!border03.ams.xsnews.nl!feeder04.ams.xsnews.nl!feeder02.ams.xsnews.nl!frontend-F10-07.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada Subject: GTK 3.8 Graphic programming Date: Fri, 3 Jan 2014 11:44:48 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3555.308 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3555.308 Message-ID: <52c69509$0$22518$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1388745993 news.kpn.nl 22518 77.168.179.107@kpn/77.168.179.107:53815 X-Original-Bytes: 2311 Xref: number.nntp.dca.giganews.com comp.lang.ada:184339 Date: 2014-01-03T11:44:48+01:00 List-Id: 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