February 2018
Intermediate to advanced
456 pages
9h 56m
English
Now, we are going to implement the menu panel, which will be the container class that will accommodate all the menu items, handle events, and perform rendering on the terminal screen.
Before we start with the implementation of the menu panel, let's add an enumeration that will represent different item alignment options, so we can have a bit more flexibility on how to display the menu items inside the menu.
Create a file called alignment.py in the musicterminal/client directory with the following contents:
from enum import Enum, autoclass Alignment(Enum): LEFT = auto() RIGHT = auto()
You should be an enumeration expert if you followed the code in the first chapter. There's nothing as complicated here; we define ...