Handle selecting a font from the list. Event can result from either mouse click or Up or Down key. Set font_name and example displays to selection.
(self, event)
| 425 | self.set_samples() |
| 426 | |
| 427 | def on_fontlist_select(self, event): |
| 428 | """Handle selecting a font from the list. |
| 429 | |
| 430 | Event can result from either mouse click or Up or Down key. |
| 431 | Set font_name and example displays to selection. |
| 432 | """ |
| 433 | font = self.fontlist.get( |
| 434 | ACTIVE if event.type.name == 'KeyRelease' else ANCHOR) |
| 435 | self.font_name.set(font.lower()) |
| 436 | |
| 437 | def set_samples(self, event=None): |
| 438 | """Update both screen samples with the font settings. |