Skip to content

Commit

Permalink
Adding support for string-only Listbox elements
Browse files Browse the repository at this point in the history
  • Loading branch information
CRImier committed May 29, 2018
1 parent a84995d commit 173c78a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ui/listbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ def get_return_value(self):
else:
return self.contents[self.selected_entry][1]

def process_contents(self):
# Replacing string-based entry labels with single-element lists
for i, entry in enumerate(self.contents):
if isinstance(entry, basestring):
self.contents[i] = [entry]
logger.debug("{}: contents processed".format(self.name))

@to_be_foreground
def select_entry(self):
""" Gets the currently specified entry's index and sets it as selected_entry attribute.
Expand Down

0 comments on commit 173c78a

Please sign in to comment.