# Class k.u.p.ProxyWidgetMixin(object):

Part of kiwi.ui.proxywidget View In Hierarchy

Known subclasses: kiwi.ui.proxywidget.ValidatableProxyWidgetMixin, kiwi.ui.widgets.button.ProxyButton, kiwi.ui.widgets.checkbutton.ProxyCheckButton, kiwi.ui.widgets.colorbutton.ProxyColorButton, kiwi.ui.widgets.combo.ProxyComboBox, kiwi.ui.widgets.filechooser.ProxyFileChooserButton, kiwi.ui.widgets.filechooser.ProxyFileChooserWidget, kiwi.ui.widgets.fontbutton.ProxyFontButton, kiwi.ui.widgets.label.ProxyLabel, kiwi.ui.widgets.radiobutton.ProxyRadioButton, kiwi.ui.widgets.scale.ProxyHScale, kiwi.ui.widgets.scale.ProxyVScale

This class is a mixin that provide a common interface for KiwiWidgets.

Usually the Proxy class need to set and get data from the widgets. It also need a validation framework.

Class Variables | allowed_data_types | A list of types which we are allowed to use in this class.

Method | __init__ | Undocumented
Method | prop_set_data_type | Set the data type for the widget
Method | set_data_format | Undocumented
Method | set_options_for_datatype | Set some options to be passed to the datatype converter.
Method | read | Get the content of the widget.
Method | update | Update the content value of the widget.
Method | _as_string | Convert a value to a string
Method | _from_string | Convert a string to the data type of the widget

def __init__(self):
overridden in kiwi.ui.proxywidget.ValidatableProxyWidgetMixin, kiwi.ui.widgets.button.ProxyButton, kiwi.ui.widgets.checkbutton.ProxyCheckButton, kiwi.ui.widgets.colorbutton.ProxyColorButton, kiwi.ui.widgets.combo.ProxyComboBox, kiwi.ui.widgets.filechooser.ProxyFileChooserButton, kiwi.ui.widgets.filechooser.ProxyFileChooserWidget, kiwi.ui.widgets.fontbutton.ProxyFontButton, kiwi.ui.widgets.label.ProxyLabel, kiwi.ui.widgets.radiobutton.ProxyRadioButton, kiwi.ui.widgets.scale.ProxyHScale, kiwi.ui.widgets.scale.ProxyVScale
Undocumented
def prop_set_data_type(self, data_type):
overridden in kiwi.ui.widgets.entry.ProxyEntry, kiwi.ui.widgets.label.ProxyLabel
Set the data type for the widget

Parameters | data_type | can be None, a type object or a string with the name of the type object, so None, "<type 'str'>" or 'str'

def set_data_format(self, format):
Undocumented
def set_options_for_datatype(self, datatype, **options):
Set some options to be passed to the datatype converter. Any additional parameter will be passed the the converter when converting an object to a string, for displaying in the widget. Note that the converter.as_string method should be able to handle such parameters.

Parameters | datatype | the datatype.

def read(self):
overridden in kiwi.ui.widgets.button.ProxyButton, kiwi.ui.widgets.checkbutton.ProxyCheckButton, kiwi.ui.widgets.colorbutton.ProxyColorButton, kiwi.ui.widgets.combo.ProxyComboBox, kiwi.ui.widgets.combo.ProxyComboBoxEntry, kiwi.ui.widgets.combo.ProxyComboEntry, kiwi.ui.widgets.entry.ProxyDateEntry, kiwi.ui.widgets.entry.ProxyEntry, kiwi.ui.widgets.fontbutton.ProxyFontButton, kiwi.ui.widgets.label.ProxyLabel, kiwi.ui.widgets.radiobutton.ProxyRadioButton, kiwi.ui.widgets.spinbutton.ProxySpinButton, kiwi.ui.widgets.textview.ProxyTextView
Get the content of the widget. The type of the return value

Returns | None if the user input a invalid value (type: Must matche the data-type property. )

def update(self, value):
overridden in kiwi.ui.widgets.button.ProxyButton, kiwi.ui.widgets.checkbutton.ProxyCheckButton, kiwi.ui.widgets.colorbutton.ProxyColorButton, kiwi.ui.widgets.combo.ProxyComboBox, kiwi.ui.widgets.combo.ProxyComboBoxEntry, kiwi.ui.widgets.combo.ProxyComboEntry, kiwi.ui.widgets.entry.ProxyDateEntry, kiwi.ui.widgets.entry.ProxyEntry, kiwi.ui.widgets.fontbutton.ProxyFontButton, kiwi.ui.widgets.label.ProxyLabel, kiwi.ui.widgets.radiobutton.ProxyRadioButton, kiwi.ui.widgets.spinbutton.ProxySpinButton, kiwi.ui.widgets.textview.ProxyTextView
Update the content value of the widget.

Parameters | value |

def _as_string(self, data):
Convert a value to a string

Parameters | data | data to convert

def _from_string(self, data):
Convert a string to the data type of the widget This may raise a `kiwi.datatypes.ValidationError` if conversion failed

Parameters | data | data to convert