def insert_watch(w, size, key):
    watch_edit = urwid.Edit([('label', 'Watch expression: ')])
    if self.dialog(urwid.ListBox(urwid.SimpleListWalker([urwid.AttrMap(watch_edit, 'value')])), [('OK', True), ('Cancel', False)], title='Add Watch Expression'):
        from pudb.var_view import WatchExpression
        we = WatchExpression(watch_edit.get_edit_text())
        fvi = self.get_frame_var_info(read_only=False)
        fvi.watches.append(we)
        self.update_var_view()
def insert_watch(w, size, key):
    watch_edit = urwid.Edit([('label', 'Watch expression: ')])
    if self.dialog(urwid.ListBox(urwid.SimpleListWalker([urwid.AttrMap(watch_edit, 'value')])), [('OK', True), ('Cancel', False)], title='Add Watch Expression'):
        from pudb.var_view import WatchExpression
        we = WatchExpression(watch_edit.get_edit_text())
        fvi = self.get_frame_var_info(read_only=False)
        fvi.watches.append(we)
        self.update_var_view()