ported wmoo to python3

This commit is contained in:
Fredrick W. Warren 2024-09-09 01:24:47 -06:00
parent 667724990c
commit 259f902f75

View File

@ -1,5 +1,6 @@
import sys, time
import pywmhelpers
import wmdocklib.pywmhelpers as pywmhelpers
import wmdocklib.pywmgeneral as pywmgeneral
debug = 0
@ -44,7 +45,7 @@ class Application:
if size is None:
size = (self._char_width * len(text), self._char_height)
pixmapwidth = self._char_width * len(text)
import pywmgeneral
# import pywmgeneral
labelPixmap = pywmgeneral.Drawable(pixmapwidth, self._char_height)
self._elements[labelId] = [orig, size, pixmapwidth, 0, labelPixmap]
self.setLabelText(labelId, text)
@ -55,7 +56,6 @@ class Application:
(orig_x,orig_y), (size_x, size_y), width, offset, pixmap = self._elements[labelId]
newwidth = self._char_width * len(text)
if newwidth > width:
import pywmgeneral
pixmap = pywmgeneral.Drawable(newwidth, self._char_height)
self._elements[labelId][4] = pixmap
self._elements[labelId][2] = newwidth
@ -101,7 +101,7 @@ class Application:
mouse or keyboard event. all fields may be left to their 'None'
default value, in which case the callback is activated on any event.
"""
if area is not None and len(area) is not 4:
if area is not None and len(area) != 4:
area = None
self._events.append( (type, key, area, callback,) )
pass