kopia lustrzana https://github.com/peterhinch/micropython-micro-gui
Writer and Listbox bug fixes.
rodzic
6f7a9e8914
commit
a931e1a14e
|
@ -150,6 +150,8 @@ class Writer():
|
|||
self._printline(rstr, invert) # Recurse
|
||||
|
||||
def stringlen(self, string, oh=False):
|
||||
if not len(string):
|
||||
return 0
|
||||
sc = self._getstate().text_col # Start column
|
||||
wd = self.screenwidth
|
||||
l = 0
|
||||
|
|
|
@ -79,7 +79,8 @@ class Listbox(Widget):
|
|||
eh = self.entry_height
|
||||
ntop = self.ntop
|
||||
dlines = self.dlines
|
||||
for n in range(ntop, ntop + dlines):
|
||||
nlines = min(dlines, len(self.elements)) # Displayable lines
|
||||
for n in range(ntop, ntop + nlines):
|
||||
if n == self._value:
|
||||
display.fill_rect(x, y + 1, self.width, eh - 1, self.select_color)
|
||||
display.print_left(self.writer, x + 2, y + 1, self.elements[n], self.fontcolor, self.select_color)
|
||||
|
|
Ładowanie…
Reference in New Issue