summaryrefslogtreecommitdiff
path: root/urwid
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2013-12-26 11:04:25 -0500
committerIan Ward <ian@excess.org>2013-12-26 11:04:25 -0500
commitab6e278967cdb30602545e99e95e65d47d3b0931 (patch)
treefff7c05737da7342330268e9e0dd5b10a5d055fd /urwid
parent449cf902a327b17f432d81e323924bcac5aa78b7 (diff)
downloadurwid-ab6e278967cdb30602545e99e95e65d47d3b0931.tar.gz
update doctests for new connect_signal return value
Diffstat (limited to 'urwid')
-rwxr-xr-xurwid/wimp.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/urwid/wimp.py b/urwid/wimp.py
index d8a47c6..cd79e44 100755
--- a/urwid/wimp.py
+++ b/urwid/wimp.py
@@ -208,8 +208,8 @@ class CheckBox(WidgetWrap):
>>> def callback_b(cb, state):
... changes.append("B %r" % state)
>>> cb = CheckBox('test', False, False)
- >>> connect_signal(cb, 'change', callback_a, "user_a")
- >>> connect_signal(cb, 'change', callback_b)
+ >>> key1 = connect_signal(cb, 'change', callback_a, "user_a")
+ >>> key2 = connect_signal(cb, 'change', callback_b)
>>> cb.set_state(True) # both callbacks will be triggered
>>> cb.state
True
@@ -390,7 +390,7 @@ class RadioButton(CheckBox):
(False, True, False)
>>> def relabel_button(radio_button, new_state):
... radio_button.set_label(u"Think Harder!")
- >>> connect_signal(b3, 'change', relabel_button)
+ >>> key = connect_signal(b3, 'change', relabel_button)
>>> b3
<RadioButton selectable flow widget 'Unsure' state=False>
>>> b3.set_state(True) # this will trigger the callback
@@ -523,7 +523,7 @@ class Button(WidgetWrap):
>>> clicked_buttons = []
>>> def handle_click(button):
... clicked_buttons.append(button.label)
- >>> connect_signal(b, 'click', handle_click)
+ >>> key = connect_signal(b, 'click', handle_click)
>>> b.keypress(size, 'enter')
>>> b.keypress(size, ' ')
>>> clicked_buttons # ... = u in Python 2
@@ -543,7 +543,7 @@ class Button(WidgetWrap):
>>> clicked_buttons = []
>>> def handle_click(button):
... clicked_buttons.append(button.label)
- >>> connect_signal(b, 'click', handle_click)
+ >>> key = connect_signal(b, 'click', handle_click)
>>> b.mouse_event(size, 'mouse press', 1, 4, 0, True)
True
>>> b.mouse_event(size, 'mouse press', 2, 4, 0, True) # ignored