diff options
| author | troido <troido@protonmail.com> | 2018-09-09 14:52:59 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2018-09-09 14:52:59 +0200 |
| commit | 9fe119a95b4cd8ab23ea30db9a72645063da264f (patch) | |
| tree | 82c4ee67fb43cfb31a475ae598ac3abf902b307e /asciifarm/client/display/switcher.py | |
| parent | 5bd11fd1914ea6744852b78047b207e521a304f1 (diff) | |
switchable menus are now somewhat usable and presentable
Diffstat (limited to 'asciifarm/client/display/switcher.py')
| -rw-r--r-- | asciifarm/client/display/switcher.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/asciifarm/client/display/switcher.py b/asciifarm/client/display/switcher.py index 196aa88..b62e650 100644 --- a/asciifarm/client/display/switcher.py +++ b/asciifarm/client/display/switcher.py @@ -1,5 +1,5 @@ -from .widimp import WidImp + from .inventory import Inventory class Switcher(Inventory): @@ -8,7 +8,7 @@ class Switcher(Inventory): """ def __init__(self, widgets, initial=0): - Inventory.__init__(self, " ") + Inventory.__init__(self, "", "") self.setInventory(widgets) for wid in widgets: @@ -19,7 +19,11 @@ class Switcher(Inventory): def doSelect(self, value): self.getSelectedItem().hidden = True self.selector = value + self.change() newWid = self.getSelectedItem() newWid.hidden = False newWid.change() + def itemName(self, item): + return item.getImpl().title + |
