[gtkada] Testgtk of GtkAda-1.3.12 on Windows 2000
Anh Vo
Anh.Vo at udlp.com
Thu Sep 12 04:13:19 CEST 2002
A Constraint_Error is raised at gtkada-canvas.adb:2758 any time the
Canvas, under GtkAda Demo tab, is zoomed out. I spotted the problem
after examining it closely. The culprit code is included below for easy
discussion.
Canvas.Zoom_Step := (Gint (Percent - Canvas.Zoom) / Gint
(Steps));
both Percent and Canvas.Zoom are unsigned type GUint. When the canvas
is zoomed in, the Percent is less than Canvas.Zoom. The subtraction
operation yield a negative number. It is out of GUint range. Therefore,
Constraint_Error was raised. The fix that I put in is shown below.
Canvas.Zoom_Step := (Gint (Percent) - Gint (Canvas.Zoom)) /
Gint (Steps);
I just wonder how it behaves on Unix. Could some one run it and let me
know? Thanks.
Anh Vo
More information about the gtkada
mailing list