summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-12-26 13:06:52 (GMT)
committerGuido van Rossum <guido@python.org>1991-12-26 13:06:52 (GMT)
commit8fd7eee6dbd7d32d1941c5eb9d6c5a2517bec99c (patch)
treea2ae4ea022bad8f7b9f6a92bb30a0f62a63ed4b4 /Lib
parentccfd6e105b5a53578ff3ebf99eb7da58a47e2d9a (diff)
downloadcpython-8fd7eee6dbd7d32d1941c5eb9d6c5a2517bec99c.zip
cpython-8fd7eee6dbd7d32d1941c5eb9d6c5a2517bec99c.tar.gz
cpython-8fd7eee6dbd7d32d1941c5eb9d6c5a2517bec99c.tar.bz2
Use new stdwinevents.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/lib-stdwin/tablewin.py11
-rw-r--r--Lib/lib-stdwin/textwin.py12
-rwxr-xr-xLib/stdwin/tablewin.py11
-rwxr-xr-xLib/stdwin/textwin.py12
4 files changed, 20 insertions, 26 deletions
diff --git a/Lib/lib-stdwin/tablewin.py b/Lib/lib-stdwin/tablewin.py
index 05a954e..f9ab907 100644
--- a/Lib/lib-stdwin/tablewin.py
+++ b/Lib/lib-stdwin/tablewin.py
@@ -16,6 +16,7 @@
import stdwin
import gwin
+from stdwinevents import *
def open(title, data): # Public function to open a table window
#
@@ -163,15 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data))
return len(w.data)
def arrow(w, type):
- import stdwinsupport
- S = stdwinsupport
- if type = S.wc_left:
+ if type = WC_LEFT:
incr = -1, 0
- elif type = S.wc_up:
+ elif type = WC_UP:
incr = 0, -1
- elif type = S.wc_right:
+ elif type = WC_RIGHT:
incr = 1, 0
- elif type = S.wc_down:
+ elif type = WC_DOWN:
incr = 0, 1
else:
return
diff --git a/Lib/lib-stdwin/textwin.py b/Lib/lib-stdwin/textwin.py
index a003a9a..778717f 100644
--- a/Lib/lib-stdwin/textwin.py
+++ b/Lib/lib-stdwin/textwin.py
@@ -3,10 +3,8 @@
# Text windows, a subclass of gwin
import stdwin
-import stdwinsupport
import gwin
-
-S = stdwinsupport # Shorthand
+from stdwinevents import *
def fixsize(w):
@@ -68,7 +66,7 @@ def char(w, c): # Char method
fixsize(w)
def backspace(w): # Backspace method
- void = w.text.event(S.we_command, w, S.wc_backspace)
+ void = w.text.event(WE_COMMAND, w, WC_BACKSPACE)
fixsize(w)
def arrow(w, detail): # Arrow method
@@ -76,14 +74,14 @@ def arrow(w, detail): # Arrow method
fixeditmenu(w)
def mdown(w, detail): # Mouse down method
- void = w.text.event(S.we_mouse_down, w, detail)
+ void = w.text.event(WE_MOUSE_DOWN, w, detail)
fixeditmenu(w)
def mmove(w, detail): # Mouse move method
- void = w.text.event(S.we_mouse_move, w, detail)
+ void = w.text.event(WE_MOUSE_MOVE, w, detail)
def mup(w, detail): # Mouse up method
- void = w.text.event(S.we_mouse_up, w, detail)
+ void = w.text.event(WE_MOUSE_UP, w, detail)
fixeditmenu(w)
def activate(w): # Activate method
diff --git a/Lib/stdwin/tablewin.py b/Lib/stdwin/tablewin.py
index 05a954e..f9ab907 100755
--- a/Lib/stdwin/tablewin.py
+++ b/Lib/stdwin/tablewin.py
@@ -16,6 +16,7 @@
import stdwin
import gwin
+from stdwinevents import *
def open(title, data): # Public function to open a table window
#
@@ -163,15 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data))
return len(w.data)
def arrow(w, type):
- import stdwinsupport
- S = stdwinsupport
- if type = S.wc_left:
+ if type = WC_LEFT:
incr = -1, 0
- elif type = S.wc_up:
+ elif type = WC_UP:
incr = 0, -1
- elif type = S.wc_right:
+ elif type = WC_RIGHT:
incr = 1, 0
- elif type = S.wc_down:
+ elif type = WC_DOWN:
incr = 0, 1
else:
return
diff --git a/Lib/stdwin/textwin.py b/Lib/stdwin/textwin.py
index a003a9a..778717f 100755
--- a/Lib/stdwin/textwin.py
+++ b/Lib/stdwin/textwin.py
@@ -3,10 +3,8 @@
# Text windows, a subclass of gwin
import stdwin
-import stdwinsupport
import gwin
-
-S = stdwinsupport # Shorthand
+from stdwinevents import *
def fixsize(w):
@@ -68,7 +66,7 @@ def char(w, c): # Char method
fixsize(w)
def backspace(w): # Backspace method
- void = w.text.event(S.we_command, w, S.wc_backspace)
+ void = w.text.event(WE_COMMAND, w, WC_BACKSPACE)
fixsize(w)
def arrow(w, detail): # Arrow method
@@ -76,14 +74,14 @@ def arrow(w, detail): # Arrow method
fixeditmenu(w)
def mdown(w, detail): # Mouse down method
- void = w.text.event(S.we_mouse_down, w, detail)
+ void = w.text.event(WE_MOUSE_DOWN, w, detail)
fixeditmenu(w)
def mmove(w, detail): # Mouse move method
- void = w.text.event(S.we_mouse_move, w, detail)
+ void = w.text.event(WE_MOUSE_MOVE, w, detail)
def mup(w, detail): # Mouse up method
- void = w.text.event(S.we_mouse_up, w, detail)
+ void = w.text.event(WE_MOUSE_UP, w, detail)
fixeditmenu(w)
def activate(w): # Activate method