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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d90e14e0a574d567 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 19 Apr 2005 16:29:52 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: graphical output with claw References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Tue, 19 Apr 2005 16:29:53 -0500 NNTP-Posting-Host: 67.161.24.234 X-Trace: sv3-fcH+X2PD1EL9I4HBruYM72Wi0O6qVc+XJQ9aRwIkHTw7jkxI2iA6K6J1d4PdXJqnFT/KfhiXOOfjNqa!mk5jXGoag3Nw/ZKPVc5P80TehTUT/FxQg1VTx8gPJ8UEg18uY6bpYCTnH+vL7g== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:10583 Date: 2005-04-19T16:29:53-05:00 List-Id: >Can somebody show me an example program with claw that draws just one >pixel in a defined color into a window? How about 50 pixels (a single pixel is hard to see) with Claw, Claw.Basic_Window, Claw.Canvas; package Pixels is type Window_Type is new Claw.Basic_Window.Basic_Window_Type with private; -- an open window of this type shows a cloud of random red dots procedure Open(Window : in out Window_Type; Title : in String); private type Window_Type is new Claw.Basic_Window.Basic_Window_Type with record Is_Active : Boolean := False; end record; procedure When_Draw(Window : in out Window_Type; Easel : in out Claw.Canvas.Basic_Canvas_Type'Class; Erase_Background : in Boolean; Area : in Claw.Rectangle_Type); end Pixels; ----------------- with Ada.Numerics.Float_Random, Claw.Bitmaps; package body Pixels is Gen : Ada.Numerics.Float_Random.Generator; procedure Open(Window : in out Window_Type; Title : in String) is begin Create(Window, Title); Show(Window, Claw.Codes.Show_Startup); Window.Is_Active := True; Update(Window); end Open; procedure When_Draw(Window : in out Window_Type; Easel : in out Claw.Canvas.Basic_Canvas_Type'Class; Erase_Background : in Boolean; Area : in Claw.Rectangle_Type) is use Ada.Numerics.Float_Random; begin if Window.Is_Active then for i in 1 .. 50 loop Claw.Bitmaps.Set_Pixel(Easel, (X=>Claw.Int(10.0+40.0*Random(Gen)), Y=>Claw.Int(10.0+20.0*Random(Gen))), Claw.Colors.RGB(Red=>255,Blue=>0,Green=>0)); end loop; end if; end When_Draw; end Pixels; ----------------- with Claw, Pixels; procedure Showdots is A_Window : Pixels.Window_Type; begin Pixels.Open(A_Window,"Simple Example"); delay 10.0; end Showdots;