Mercurial > mamba
changeset 289:a44eabb108a5
Make prompt text a parameter
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Thu, 15 Sep 2011 23:03:24 +0200 |
parents | 325a4437439b |
children | a0c60e0c1ef2 |
files | mamba/widgets/text.py |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mamba/widgets/text.py Thu Sep 15 23:13:41 2011 +0200 +++ b/mamba/widgets/text.py Thu Sep 15 23:03:24 2011 +0200 @@ -69,7 +69,8 @@ class EntryTextWidget(TextWidget): def __init__(self, rect, text, **kwargs): self.focus_color = kwargs.pop('focus_color', FOCUS_COLOR) - text = 'Entry: %s' % text + self.prompt = kwargs.pop('prompt', 'Entry:') + text = '%s %s' % (self.prompt, text) self.base_color = COLOR self.update_func = kwargs.pop('update', None) super(EntryTextWidget, self).__init__(rect, text, **kwargs) @@ -80,7 +81,7 @@ self.add_callback(KEYDOWN, self.update_func) def update(self, new_value): - self.text = 'Entry: %s' % new_value + self.text = '%s %s' % (self.prompt, new_value) self.prepare() def prepare(self):