Commit 8d97b9bd authored by Just van Rossum's avatar Just van Rossum

fixed some DeprecationWarnings

parent 8fb665a5
...@@ -8,6 +8,10 @@ class WidgetsError(Exception): pass ...@@ -8,6 +8,10 @@ class WidgetsError(Exception): pass
DEBUG = 0 DEBUG = 0
def _intRect((l, t, r, b)):
return (int(l), int(t), int(r), int(b))
class Widget: class Widget:
"""Base class for all widgets.""" """Base class for all widgets."""
...@@ -115,7 +119,7 @@ class Widget: ...@@ -115,7 +119,7 @@ class Widget:
# the bounds relative to our parent widget. # the bounds relative to our parent widget.
width = pr - pl width = pr - pl
height = pb - pt height = pb - pt
self._bounds = Qd.OffsetRect(self._possize(width, height), pl, pt) self._bounds = Qd.OffsetRect(_intRect(self._possize(width, height)), pl, pt)
else: else:
# _possize must be a 4-tuple. This is where the algorithm by Peter Kriens and # _possize must be a 4-tuple. This is where the algorithm by Peter Kriens and
# Petr van Blokland kicks in. (*** Parts of this algorithm are applied for # Petr van Blokland kicks in. (*** Parts of this algorithm are applied for
...@@ -571,7 +575,7 @@ class HorizontalPanes(Widget): ...@@ -571,7 +575,7 @@ class HorizontalPanes(Widget):
# track mouse --- XXX move to separate method? # track mouse --- XXX move to separate method?
Qd.PenMode(QuickDraw.srcXor) Qd.PenMode(QuickDraw.srcXor)
Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PenPat(Qd.GetQDGlobalsGray())
Qd.PaintRect(rect) Qd.PaintRect(_intRect(rect))
lastpos = None lastpos = None
while Evt.Button(): while Evt.Button():
pos = orgpos - orgmouse + Evt.GetMouse()[self._direction] pos = orgpos - orgmouse + Evt.GetMouse()[self._direction]
...@@ -580,17 +584,17 @@ class HorizontalPanes(Widget): ...@@ -580,17 +584,17 @@ class HorizontalPanes(Widget):
if pos == lastpos: if pos == lastpos:
continue continue
Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PenPat(Qd.GetQDGlobalsGray())
Qd.PaintRect(rect) Qd.PaintRect(_intRect(rect))
if self._direction: if self._direction:
rect = l, pos - 1, r, pos rect = l, pos - 1, r, pos
else: else:
rect = pos - 1, t, pos, b rect = pos - 1, t, pos, b
Qd.PenPat(Qd.GetQDGlobalsGray()) Qd.PenPat(Qd.GetQDGlobalsGray())
Qd.PaintRect(rect) Qd.PaintRect(_intRect(rect))
lastpos = pos lastpos = pos
self._parentwindow.wid.GetWindowPort().QDFlushPortBuffer(None) self._parentwindow.wid.GetWindowPort().QDFlushPortBuffer(None)
Evt.WaitNextEvent(0, 3) Evt.WaitNextEvent(0, 3)
Qd.PaintRect(rect) Qd.PaintRect(_intRect(rect))
Qd.PenNormal() Qd.PenNormal()
SetCursor("watch") SetCursor("watch")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment