summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1990-10-31 11:17:34 (GMT)
committerGuido van Rossum <guido@python.org>1990-10-31 11:17:34 (GMT)
commite15607f3f930c5e292195490ae38135758fc31d2 (patch)
treeeb5360c208c071029b0f9481d2a95ca22931dc0b
parentfc9af02697b248f4f6f8c9b1c64af34e8eda9551 (diff)
downloadcpython-e15607f3f930c5e292195490ae38135758fc31d2.zip
cpython-e15607f3f930c5e292195490ae38135758fc31d2.tar.gz
cpython-e15607f3f930c5e292195490ae38135758fc31d2.tar.bz2
removed resizing functionality.
-rw-r--r--Lib/lib-stdwin/Histogram.py20
-rwxr-xr-xLib/stdwin/Histogram.py20
2 files changed, 12 insertions, 28 deletions
diff --git a/Lib/lib-stdwin/Histogram.py b/Lib/lib-stdwin/Histogram.py
index a023938..f469272 100644
--- a/Lib/lib-stdwin/Histogram.py
+++ b/Lib/lib-stdwin/Histogram.py
@@ -1,22 +1,22 @@
# Module 'Histogram'
from Buttons import *
+from Resize import Resize
# A Histogram displays a histogram of numeric data.
# It reacts to resize events by resizing itself,
# leaving the same amount of space around the borders.
+# (This is geometry management, and should really be implemented
+# by a different group of classes, but for now this hack is OK.)
#
-class HistogramAppearance() = LabelAppearance():
+class HistogramAppearance() = Resize(), LabelAppearance():
#
def define(self, (win, bounds, ydata, scale)):
self.init_appearance(win, bounds)
+ self.init_resize()
self.ydata = ydata
self.scale = scale # (min, max)
- self.left_top, (right, bottom) = bounds
- width, height = win.getwinsize()
- self.right_margin = width - right
- self.bottom_margin = height - bottom
return self
#
def setdata(self, (ydata, scale)):
@@ -37,13 +37,5 @@ class HistogramAppearance() = LabelAppearance():
v1 = top + height
d.paint((h0, v0), (h1, v1))
#
- def resize(self):
- width, height = self.win.getwinsize()
- right = width - self.right_margin
- bottom = height - self.bottom_margin
- self.setbounds(self.left_top, (right, bottom))
- #
-
-class HistogramReactivity() = NoReactivity(): pass
-class Histogram() = HistogramAppearance(), HistogramReactivity(): pass
+class Histogram() = HistogramAppearance(), NoReactivity(): pass
diff --git a/Lib/stdwin/Histogram.py b/Lib/stdwin/Histogram.py
index a023938..f469272 100755
--- a/Lib/stdwin/Histogram.py
+++ b/Lib/stdwin/Histogram.py
@@ -1,22 +1,22 @@
# Module 'Histogram'
from Buttons import *
+from Resize import Resize
# A Histogram displays a histogram of numeric data.
# It reacts to resize events by resizing itself,
# leaving the same amount of space around the borders.
+# (This is geometry management, and should really be implemented
+# by a different group of classes, but for now this hack is OK.)
#
-class HistogramAppearance() = LabelAppearance():
+class HistogramAppearance() = Resize(), LabelAppearance():
#
def define(self, (win, bounds, ydata, scale)):
self.init_appearance(win, bounds)
+ self.init_resize()
self.ydata = ydata
self.scale = scale # (min, max)
- self.left_top, (right, bottom) = bounds
- width, height = win.getwinsize()
- self.right_margin = width - right
- self.bottom_margin = height - bottom
return self
#
def setdata(self, (ydata, scale)):
@@ -37,13 +37,5 @@ class HistogramAppearance() = LabelAppearance():
v1 = top + height
d.paint((h0, v0), (h1, v1))
#
- def resize(self):
- width, height = self.win.getwinsize()
- right = width - self.right_margin
- bottom = height - self.bottom_margin
- self.setbounds(self.left_top, (right, bottom))
- #
-
-class HistogramReactivity() = NoReactivity(): pass
-class Histogram() = HistogramAppearance(), HistogramReactivity(): pass
+class Histogram() = HistogramAppearance(), NoReactivity(): pass