Obtaining rectangle coordinates after a repaint - OS2
This is a discussion on Obtaining rectangle coordinates after a repaint - OS2 ; Hello,
I populate a container in details view with a number of rows. There are
enough so that the window must be scrolled to see all of them.
If a row is selected, I query the row's position with
CM_QUERYRECORDRECT, ...
-
Obtaining rectangle coordinates after a repaint
Hello,
I populate a container in details view with a number of rows. There are
enough so that the window must be scrolled to see all of them.
If a row is selected, I query the row's position with
CM_QUERYRECORDRECT, and position the window with CM_SCROLLWINDOW.
After loading the window and setting the various rows' attributes, I
call CM_INVALIDATERECORD to update the window, followed by WinShowWindow().
The problem is that it would seem the window update runs in a separate
thread and is not necessarily completed when the CM_QUERYRECORDRECT is
sent. The result is invalid rectangle data; there is no error indication.
If I add a delay before the query, say 100 - 200 mSec, the query succeeds
as expected.
Is there some flag that can be tested to know when a window's geometry
is stable?
--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
-
Re: Obtaining rectangle coordinates after a repaint
In , on 09/18/2008
at 07:43 PM, Jim Moe said:
Hi,
> If a row is selected, I query the row's position with
>CM_QUERYRECORDRECT, and position the window with CM_SCROLLWINDOW.
> After loading the window and setting the various rows' attributes, I
>call CM_INVALIDATERECORD to update the window, followed by
>WinShowWindow().
> The problem is that it would seem the window update runs in a separate
>thread and is not necessarily completed when the CM_QUERYRECORDRECT is
>sent.
If this is the case, pmmail is probably doing part of the work in an
object window.
If so, one relatively easy way to synchronize the threads is to post a
message to the GUI thread when the object thread completes its work. This
can trigger the GUI thread to finish the work that must be done on the GUI
thread.
> Is there some flag that can be tested to know when a window's geometry
>is stable?
No. You need to write code that properly synchronizes work done by
multiple threads.
Steven
--
--------------------------------------------------------------------------------------------
Steven Levine MR2/ICE 3.00.11.17 BETA #10183
eCS/Warp/DIY/14.103a_W4 www.scoug.com irc.ca.webbnet.info #scoug (Wed 7pm PST)
--------------------------------------------------------------------------------------------