| Home | Trees | Index | Help |
|---|
| Package ocempgui :: Package widgets :: Module Style :: Class WidgetStyle |
|
UserDict --+
|
IterableUserDict --+
|
WidgetStyle
WidgetStyle (dict=None) -> WidgetStyle
A style dictionary that tracks changes of its items.
The WidgetStyle dictionary class allows one to let a bound method be executed, whenever a value of the dictionary changed. Additionally, the WidgetStyle class supports recursive changes, so that a WidgetStyle object within this WidgetStyle can escalate the value change and so on.
To set up the value change handler you can bind it using the set_value_changed() method of the WidgetStyle class:
style.set_value_changed (callback_method)
This will cause it and all values of it, which are WidgetStyle objects to invoke the callback_method on changes.
To get the actually set value change handler, the get_value_changed() method can be used:
callback = style.get_value_changed ()| Method Summary | |
|---|---|
__init__(self,
dict)
| |
W.__copy__ () -> WidgetStyle | |
W.__deepcopy__ (...) -> WidgetStyle. | |
W.__delitem__ (i, y) <==> del w[y] | |
W.__repr__ () <==> repr (W) | |
W.__setitem__ (i, y) <==> w[i] = y | |
W.clear () -> None | |
W.get_value_changed (...) -> callable | |
W.pop (k, d=None) -> object | |
W.popitem () -> (k, v) | |
W.set_value_changed (...) -> None | |
W.setdefault (k,d=None) -> W.get (k, d), also set W[k] = d if k not in W | |
W.update (E, **F) -> None | |
| Inherited from IterableUserDict | |
| |
| Inherited from UserDict | |
| |
| |
| |
| |
| |
(Class method) | |
| |
| |
| |
| |
| |
| |
| |
| |
| Instance Method Details |
|---|
__copy__(self)W.__copy__ () -> WidgetStyle Creates a shallow copy of the WidgetStyle dictionary. |
__deepcopy__(self, memo={})W.__deepcopy__ (...) -> WidgetStyle. Creates a deep copy of the WidgetStyle dictionary. |
__delitem__(self,
y)
W.__delitem__ (i, y) <==> del w[y]
|
__repr__(self)
W.__repr__ () <==> repr (W)
|
__setitem__(self,
i,
y)
W.__setitem__ (i, y) <==> w[i] = y
|
clear(self, y)W.clear () -> None Remove all items from the WidgetStyle dictionary.
|
get_value_changed(self)W.get_value_changed (...) -> callable Gets the set callback method for the dictionary changes. |
pop(self, k, d=None)W.pop (k, d=None) -> object Remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
|
popitem(self)W.popitem () -> (k, v) Remove and return some (key, value) pair as a 2-tuple Raises a KeyError if D is empty.
|
set_value_changed(self, method)W.set_value_changed (...) -> None Connects a method to invoke, when an item of the dict changes. Raises a TypeError, if the passed argument is not callable. |
setdefault(self, k, d=None)W.setdefault (k,d=None) -> W.get (k, d), also set W[k] = d if k not in W
|
update(self, E, **F)W.update (E, **F) -> None Update W from E and F. for k in E: W[k] = E[k] (if E has keys else: for (k, v) in E: W[k] = v) then: for k in F: W[k] = F[k]
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Jan 10 10:18:43 2008 | http://epydoc.sf.net |