ported wmoo to python3
This commit is contained in:
parent
667724990c
commit
259f902f75
@ -1,5 +1,6 @@
|
|||||||
import sys, time
|
import sys, time
|
||||||
import pywmhelpers
|
import wmdocklib.pywmhelpers as pywmhelpers
|
||||||
|
import wmdocklib.pywmgeneral as pywmgeneral
|
||||||
|
|
||||||
debug = 0
|
debug = 0
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ class Application:
|
|||||||
if size is None:
|
if size is None:
|
||||||
size = (self._char_width * len(text), self._char_height)
|
size = (self._char_width * len(text), self._char_height)
|
||||||
pixmapwidth = self._char_width * len(text)
|
pixmapwidth = self._char_width * len(text)
|
||||||
import pywmgeneral
|
# import pywmgeneral
|
||||||
labelPixmap = pywmgeneral.Drawable(pixmapwidth, self._char_height)
|
labelPixmap = pywmgeneral.Drawable(pixmapwidth, self._char_height)
|
||||||
self._elements[labelId] = [orig, size, pixmapwidth, 0, labelPixmap]
|
self._elements[labelId] = [orig, size, pixmapwidth, 0, labelPixmap]
|
||||||
self.setLabelText(labelId, text)
|
self.setLabelText(labelId, text)
|
||||||
@ -55,7 +56,6 @@ class Application:
|
|||||||
(orig_x,orig_y), (size_x, size_y), width, offset, pixmap = self._elements[labelId]
|
(orig_x,orig_y), (size_x, size_y), width, offset, pixmap = self._elements[labelId]
|
||||||
newwidth = self._char_width * len(text)
|
newwidth = self._char_width * len(text)
|
||||||
if newwidth > width:
|
if newwidth > width:
|
||||||
import pywmgeneral
|
|
||||||
pixmap = pywmgeneral.Drawable(newwidth, self._char_height)
|
pixmap = pywmgeneral.Drawable(newwidth, self._char_height)
|
||||||
self._elements[labelId][4] = pixmap
|
self._elements[labelId][4] = pixmap
|
||||||
self._elements[labelId][2] = newwidth
|
self._elements[labelId][2] = newwidth
|
||||||
@ -101,7 +101,7 @@ class Application:
|
|||||||
mouse or keyboard event. all fields may be left to their 'None'
|
mouse or keyboard event. all fields may be left to their 'None'
|
||||||
default value, in which case the callback is activated on any event.
|
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
|
area = None
|
||||||
self._events.append( (type, key, area, callback,) )
|
self._events.append( (type, key, area, callback,) )
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user