MG: gtk HandleEvents will now process all pending events

git-svn-id: trunk@714 -
This commit is contained in:
lazarus 2002-02-09 01:45:41 +00:00
parent 018db1d173
commit e00b19de22

View File

@ -267,6 +267,19 @@ begin
{$ENDIF}
end;
{------------------------------------------------------------------------------
Method: TGtkObject.LCLtoGtkMessagePending
Params: None
Returns: boolean
Returns true if any messages from the lcl to the gtk is in cache and needs
delivery.
------------------------------------------------------------------------------}
function TgtkObject.LCLtoGtkMessagePending: boolean;
begin
Result:=(FWidgetsWithResizeRequest.Count>0);
end;
{------------------------------------------------------------------------------
Method: TGtkObject.SendCachedGtkMessages
Params: None
@ -490,15 +503,19 @@ var
Msg: TMsg;
p: pMsg;
begin
SendCachedLCLMessages; // send cached LCL messages to the gtk
//gtk_main;
// first let gtk handle all its messages
repeat
// send cached LCL messages to the gtk
SendCachedLCLMessages;
// let gtk handle all its messages and call our callbacks
while gtk_events_pending<>0 do
gtk_main_iteration_do(False);
SendCachedGtkMessages; // send cached gtk messages to the lcl
// send cached gtk messages to the lcl
SendCachedGtkMessages;
// then handle our own messages
with FMessageQueue do
with FMessageQueue do begin
while First<>nil do
begin
p := PMsg(First^.Data);
@ -514,6 +531,10 @@ begin
end;
Dispose(p);
end;
end;
// proceed until all messages are handled
until (gtk_events_pending=0) and (not LCLtoGtkMessagePending);
end;
{------------------------------------------------------------------------------
@ -4976,6 +4997,9 @@ end;
{ =============================================================================
$Log$
Revision 1.136 2002/06/07 06:40:18 lazarus
MG: gtk HandleEvents will now process all pending events
Revision 1.135 2002/06/06 07:23:24 lazarus
MG: small fixes to reduce form repositioing