summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cebzanov <tonycpsu@gmail.com>2019-11-05 12:13:16 -0500
committerTony Cebzanov <tonycpsu@gmail.com>2019-11-05 12:13:16 -0500
commit83315ba9d9930e3b0b839f937d060fc3039f9945 (patch)
tree97f15341a53f7481635a557a120666218da0476f
parent7e4e3ad1ee4890c0abce970ab675db4acd4cf788 (diff)
parent82d6eb8ba29e722016fa9b996fd9f42d2288095e (diff)
downloadurwid-83315ba9d9930e3b0b839f937d060fc3039f9945.tar.gz
Merge branch 'low_hanging_fruits_1' [353]
-rwxr-xr-xurwid/wimp.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/urwid/wimp.py b/urwid/wimp.py
index 33c1ee0..3dfbf39 100755
--- a/urwid/wimp.py
+++ b/urwid/wimp.py
@@ -115,7 +115,7 @@ class CheckBox(WidgetWrap):
signals = ["change", 'postchange']
def __init__(self, label, state=False, has_mixed=False,
- on_state_change=None, user_data=None):
+ on_state_change=None, user_data=None, checked_symbol=None):
"""
:param label: markup for check box label
:param state: False, True or "mixed"
@@ -149,6 +149,8 @@ class CheckBox(WidgetWrap):
self._label = Text("")
self.has_mixed = has_mixed
self._state = None
+ if checked_symbol:
+ self.states[True] = SelectableIcon(u"[%s]" % checked_symbol, 1)
# The old way of listening for a change was to pass the callback
# in to the constructor. Just convert it to the new way:
if on_state_change: