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

Part of kiwi.ui.proxywidget

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

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.

cvar allowed_data_typesA list of types which we are allowed to use in this class.
Function__init__Undocumented
Functionprop_set_data_type

Set the data type for the widget

Functionset_data_formatUndocumented
Functionset_options_for_datatype

Set some options to be passed to the datatype converter.

Functionread

Get the content of the widget.

Functionupdate

Update the content value of the widget.

Function_as_string

Convert a value to a string

Function_from_string

Convert a string to the data type of the widget

def __init__(self):
Undocumented
def prop_set_data_type(self, data_type):

Set the data type for the widget

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.

def read(self):

Get the content of the widget. The type of the return value

def update(self, value):

Update the content value of the widget.

def _as_string(self, data):

Convert a value to a string

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