mirror of
https://github.com/gryf/wmdocklib.git
synced 2025-12-31 19:12:29 +01:00
Added ability to define multiple bitmap font sources.
By defining attribute "fonts" in the DockApp inherited class, now there is possible for adding more than one character sets.
This commit is contained in:
@@ -82,7 +82,7 @@ So below is the example for displaying random number:
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.font = FONTS
|
||||
self.fonts = [wmdocklib.BitmapFonts(FONTS, self.dimensions)]
|
||||
|
||||
def run(self):
|
||||
self.prepare_pixmaps()
|
||||
@@ -91,7 +91,7 @@ So below is the example for displaying random number:
|
||||
|
||||
def main_loop(self):
|
||||
while True:
|
||||
self.add_string(f'{random.randint(0, 999):3}', 1, 1)
|
||||
self.fonts[0].add_string(f'{random.randint(0, 999):3}', 1, 1)
|
||||
self.redraw()
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user