-
Updating Screen
There are times when I use X Windows to draw something (e.g. string) in
a Window, the screen doesn't update until after I cause another event
(e.g. press a key). How can I get the screen to update following the draw?
Using SuSE Linux 9.3.
Thanks
Paul
-
Re: Updating Screen
On 2007-04-18, Paul Thompson <pault@HiWAAY.net> wrote:[color=blue]
> There are times when I use X Windows to draw something (e.g. string) in
> a Window, the screen doesn't update until after I cause another event
> (e.g. press a key). How can I get the screen to update following the draw?
>
> Using SuSE Linux 9.3.[/color]
I probably won't know the answer, but I would guess those
who might would need at least a code fragment in order to
have any idea of what might solve the problem.
--
Robert Riches
[email]spamtrap42@verizon.net[/email]
(Yes, that is one of my email addresses.)
-
Re: Updating Screen
In article <132ct1ssfgq5636@corp.supernews.com>, Paul Thompson <pault@HiWAAY.net> writes:[color=blue]
> There are times when I use X Windows to draw something (e.g. string) in
> a Window, the screen doesn't update until after I cause another event
> (e.g. press a key). How can I get the screen to update following the draw?[/color]
Have you tried calling XFlush() after the draw?
George Cook
WVNET
-
Re: Updating Screen
Paul Thompson wrote:[color=blue]
> There are times when I use X Windows to draw something (e.g. string) in
> a Window, the screen doesn't update until after I cause another event
> (e.g. press a key). How can I get the screen to update following the draw?
>
> Using SuSE Linux 9.3.
>
> Thanks
> Paul[/color]
Try XSync()
but don't overuse it, as it slows down the program
considerably.
Alternatively, something could be wrong with your redraw logic.
Sometimes, a good old printf will tell you if the draw code is
actually executed when you think it is.
Best regards
Dušan Peterc
[url]http://www.arahne.si[/url]
-
Re: Updating Screen
"arahne" <arahne@arahne.si> wrote in message
news:5SJVh.722$553.581268@news.siol.net...[color=blue]
> Paul Thompson wrote:[color=green]
>> There are times when I use X Windows to draw something (e.g. string) in
>> a Window, the screen doesn't update until after I cause another event
>> (e.g. press a key). How can I get the screen to update following the
>> draw?
>>
>> Using SuSE Linux 9.3.
>>
>> Thanks
>> Paul[/color]
> Try XSync()
> but don't overuse it, as it slows down the program
> considerably.
> Alternatively, something could be wrong with your redraw logic.
> Sometimes, a good old printf will tell you if the draw code is
> actually executed when you think it is.
>[/color]
XFlush() might be all that is needed. Note that XSync() blocks until all
existing events are processed, whereas XFlush() sends all pending
requests then returns immediately.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Aero Stability and Controls Computing
-
Re: Updating Screen
On Apr 18, 3:40 pm, Paul Thompson <p...@HiWAAY.net> wrote:[color=blue]
> There are times when I use X Windows to draw something (e.g. string) in
> a Window, the screen doesn't update until after I cause another event
> (e.g. press a key). How can I get the screen to update following the draw?
>
> Using SuSE Linux 9.3.
>
> Thanks
> Paul[/color]
Also, might want to try XSynchronize(dpy, True);
I think this should only be used during debugging however. Imposes
synchronous behavior as opposed to the default.
-
Re: Updating Screen
Thanks folks, it appears XSync solves the problem.
Paul Thompson wrote:[color=blue]
> There are times when I use X Windows to draw something (e.g. string) in
> a Window, the screen doesn't update until after I cause another event
> (e.g. press a key). How can I get the screen to update following the draw?
>
> Using SuSE Linux 9.3.
>
> Thanks
> Paul[/color]