comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: graphical output on win xp with gnavi-package
Date: Thu, 7 Apr 2005 18:32:11 -0500
Date: 2005-04-07T18:32:11-05:00	[thread overview]
Message-ID: <vvWdnWBLhrzzX8jfRVn-sQ@megapath.net> (raw)
In-Reply-To: e499e546.0504070745.7df0f90b@posting.google.com

"Duke Luke" <duke_luke@gmx.de> 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.






  reply	other threads:[~2005-04-07 23:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-07 15:45 graphical output on win xp with gnavi-package Duke Luke
2005-04-07 23:32 ` Randy Brukardt [this message]
2005-04-08 13:57   ` Duke Luke
2005-04-08 18:33     ` Randy Brukardt
2005-04-08 14:52 ` Dmitry A. Kazakov
2005-04-08 18:47   ` Duke Luke
2005-04-08 20:21     ` Dmitry A. Kazakov
2005-04-08 20:41     ` Gautier Write-only
2005-04-08 20:42     ` tmoran
2005-04-09 11:51       ` Duke Luke
2005-04-09 18:30         ` tmoran
2005-04-11  5:37           ` Duke Luke
2005-04-12 16:18           ` Duke Luke
2005-04-12 17:24             ` tmoran
2005-04-13 15:19               ` Duke Luke
2005-04-13 18:16                 ` tmoran
2005-04-14  6:24                   ` Duke Luke
2005-04-14 17:54                     ` tmoran
2005-04-15 10:04 ` Duke Luke
2005-04-15 17:56   ` tmoran
2005-04-16  9:58     ` Duke Luke
replies disabled

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