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,23b61d4dfe367913 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 07 Apr 2005 18:29:50 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: graphical output on win xp with gnavi-package Date: Thu, 7 Apr 2005 18:32:11 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-kx7lWHUkRLWKKZC2vJy1gYKN7Cdaj7aYkzpJs3fnvoTaf46Sri8UK+O/Fz6XUKfDQBKEuV37Z7P2P/k!pFuu+l+mDgJ0H2btPhKir2+475tEmcVgtNl8KRJCNkUJP42R19Ehm6U5LUruiQ/7qTZUuUKxYnyf X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.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:10325 Date: 2005-04-07T18:32:11-05:00 List-Id: "Duke Luke" wrote in message news:e499e546.0504070745.7df0f90b@posting.google.com... > Hello, > > now most things are working as they're supposed to. > i programmed a nice tetris with the gnavi package and everything is > great. > > i have only one problem left: > when i create a window (canvas) and paint in it, it works as long as i > dont change its focus. > any time i change its focus, the whole window becomes blank and > nothing can be drawn on it further. > => this means, one cant even click on the window to activize it, > because that would make it blank! > > why does this happen and what can i do about it? > do i have to use another package? which? It's never a good idea to draw directly in a Windows window. Rather, you should do so in response to the Paint message and call Invalidate to force the window to be redrawn when needed. The Paint message gets sent (almost) anytime the window is invalidated, which includes when it gets covered by a window of another program. Using Claw, that means overriding the When_Draw action handler and drawing the window as needed. For an application like yours, you probably would use a task which updated the positions of the objects as necessary, invalidated the window, and then delayed until the next clock beat. The window object would be responsible for redrawing the window as needed. I don't know precisely how you should do this with GWindows, but I would expect it is similar (since the underlying Windows is the same). (You could always use Claw for this, see http://www.rrsoftware.com/html/prodinf/claw/claw.htm, but I don't expect that you want to start over. And you shouldn't need to.) Randy.