For a card game, I’m using a DirectOptionMenu to show the human player his/her options when it’s his/her turn such that he can select one from the popup menu in order to make a play.
The menu updates its items at the beginning of the human player’s turn through a call
self['items'] = [str(action) for action in self._actions]
where self._actions is a list of action objects that have appropriate str methods.
The display of the popup menu and the selection and action triggering work.
I initialize the DirectOptionMenu object with an empty list (as there are no options to choose from at the beginning of the game).
Now, when I update the list, the main button representing the DirectOptionMenu does not resize with the texts of the items (in contrasts to the popup, which does so correctly).
Is there any method I should call after modifying the items?