[gtkada] Problem with drawing
Emmanuel Briot
briot at ACT-Europe.FR
Thu Nov 29 16:50:43 CET 2001
Michael Gonzalez <mgh at unican.es> writes:
> The problem is that I am writing a drawing package for first-year
> students who do not know about Gtk-Ada. This means that I want them to
> keep control of their application, and just invoke the Draw operation
> when they want to refresh the drawing.
Ok, it does make sense indeed if that is for first year students that don't
know yet about GUI progamming.
> I tried, but none worked. For now, I just limited the amount of times
> that the loop executes, and the application works. But the limit is
> arbitrary, and perhaps there could be more events that would need to be
> handled. In addition, the implementation is slow because it always
> executes the events up to the limit that I set. Curiously, if I minimize
> the window then the events don't queue up.
One more thing you might want to try:
Try writting the loop somewhat like:
declare
Event : Gdk_Event;
begin
while Events_Pending loop
Gdk.Event.Get (Event);
if Event /= null then
Do_Event (Event);
end if;
end loop;
end;
It might help.
Emmanuel
More information about the gtkada
mailing list