mirror of https://github.com/chriskiehl/Gooey.git
6 changed files with 59 additions and 15 deletions
Split View
Diff Options
-
20gooey/gui/components/config.py
-
12gooey/gui/components/widgets/bases.py
-
3gooey/gui/components/widgets/checkbox.py
-
7gooey/gui/components/widgets/listbox.py
-
5gooey/gui/components/widgets/radio_group.py
-
27gooey/gui/components/widgets/textarea.py
@ -1,6 +1,29 @@ |
|||
import wx |
|||
from gooey.gui.components.widgets.core.text_input import MultilineTextInput |
|||
from gooey.gui.components.widgets.textfield import TextField |
|||
from gooey.gui.components.widgets.bases import TextContainer |
|||
from gooey.gui import formatters |
|||
|
|||
|
|||
class Textarea(TextContainer): |
|||
|
|||
def getWidget(self, parent, *args, **options): |
|||
widgetHeight = self._options.get('height', -1) |
|||
return wx.TextCtrl( |
|||
parent=parent, |
|||
size=(-1, widgetHeight), |
|||
style=wx.TE_MULTILINE | wx.TE_READONLY |
|||
) |
|||
|
|||
def getWidgetValue(self): |
|||
return self.widget.GetValue() |
|||
|
|||
def setValue(self, value): |
|||
self.widget.Clear() |
|||
self.widget.AppendText(str(value)) |
|||
self.widget.SetInsertionPoint(0) |
|||
|
|||
def formatOutput(self, metatdata, value): |
|||
return formatters.general(metatdata, value) |
|||
|
|||
|
|||
class Textarea(TextField): |
|||
widget_class = MultilineTextInput |
Write
Preview
Loading…
Cancel
Save