npcole / npyscreen

Automatically exported from code.google.com/p/npyscreen
Other
479 stars 109 forks source link

Making each widget in a multiline widget a multi-line text entry #125

Open ERROR-404-NULL-NOT-FOUND opened 1 year ago

ERROR-404-NULL-NOT-FOUND commented 1 year ago

My current solution is as follows, but it doesn't parse newlines, so it's useless to me.

class multiLineMessages(npyscreen.MultiLine):
    allow_filtering=False
    _contained_widget=npyscreen.MultiLineEdit
    _contained_widget.editable = False
    _contained_widget_height=2
    def display_value(self, vl: message):
        output=''
        for i in vl.replies:
            output+=f'> {i}\n'
        output+=f'[{vl.author}] '
        output+=f'{vl.content}'
        return output