Class k.u.p.Proxy:

Part of kiwi.ui.proxy

A Proxy is a class that 'attaches' an instance to an interface's widgets, and transparently manipulates that instance's attributes as the user alters the content of the widgets.

The Proxy takes the widget list and detects what widgets are to be attached to the model by looking if it is a KiwiWidget and if it has the model-attribute set.
Function__init__
Create a new Proxy object.
Function_reset_widgetUndocumented
Function_setup_widgetUndocumented
Function_register_proxy_in_modelUndocumented
Function_unregister_proxy_in_modelUndocumented
Function_on_widget__content_changed
This is called as soon as the content of one of the widget
Function_on_widget__notifyUndocumented
Function_get_modelUndocumented
Functionproxy_updated
This is a hook that is called whenever the proxy updates the
Functionupdate_many
Like update but takes a sequence of attributes
Functionupdate
Generic frontend function to update the contentss of a widget based
Functionset_model
Updates the model instance of the proxy.
Functionadd_widget
Adds a new widget to the proxy
Functionremove_widget
Removes a widget from the proxy
Functionnew_modelUndocumented
def __init__(self, view, model=None, widgets=()):
Create a new Proxy object.
def _reset_widget(self, attribute, widget):
Undocumented
def _setup_widget(self, widget_name, widget):
Undocumented
def _register_proxy_in_model(self, attribute):
Undocumented
def _unregister_proxy_in_model(self):
Undocumented
def _on_widget__content_changed(self, widget, attribute, validate):
This is called as soon as the content of one of the widget changes, the widgets tries fairly hard to not emit when it's not neccessary
def _on_widget__notify(self, widget, pspec):
Undocumented
def _get_model(self):
Undocumented
def proxy_updated(self, widget, attribute, value):
This is a hook that is called whenever the proxy updates the model. Implement it in the inherited class to perform actions that should be done each time the user changes something in the interface. This hook by default does nothing.
def update_many(self, attributes, value=ValueUnset, block=False):
Like update but takes a sequence of attributes
def update(self, attribute, value=ValueUnset, block=False):
Generic frontend function to update the contentss of a widget based on its model attribute name using the internal update functions.
def set_model(self, model, relax_type=False):
Updates the model instance of the proxy. Allows a proxy interface to change model without the need to destroy and recreate the UI (which would cause flashing, at least)
def add_widget(self, name, widget):
Adds a new widget to the proxy
def remove_widget(self, name):
Removes a widget from the proxy
def new_model(self, model, relax_type=False):
Undocumented