Home | Trees | Index | Help |
|
---|
Package kiwi :: Package ui :: Module views :: Class SlaveView |
|
object
--+
|
SlaveView
BaseView
,
SlaveDelegate
Base class for all View classes. Defines the essential class attributes (controller, toplevel, widgets) and handles initialization of toplevel and widgets. Once AbstractView.__init__() has been called, you can be sure self.toplevel and self.widgets are sane and processed.
When a controller is associated with a View (the view should be passed in to its constructor) it will try and call a hook in the View called _attach_callbacks. See AbstractGladeView for an example of this method.Method Summary | |
---|---|
Add a proxy to this view that automatically update a model when the view changes. | |
Attaches a slaveview to the current view, substituting the widget specified by name. | |
check_and_notify_validity(self,
force)
| |
Connect the same handler to the specified signal for a number of widgets. | |
Detatch a slave called name from view | |
Disconnect handlers previously connected with autoconnect_signals() | |
Focuses the toplevel widget in the view | |
Looks through widgets specified (if no widgets are specified, look through all widgets attached to the view and sets focus to the widget that is rendered in the position closest to the view window's top and left | |
force_validation(self)
| |
Special init code that subclasses may want to override. | |
get_slave(self,
holder)
| |
Returns the toplevel widget in the view | |
A real hack; returns the widget that is most to the left and top of the window. | |
Retrieves the named widget from the View | |
handler_block(self,
widget,
signal_name)
| |
handler_unblock(self,
widget,
signal_name)
| |
Hook function called when attach_slave is performed on slave views. | |
This is a virtual method that can be customized by classes that want to perform additional initalization after a controller has been set for it. | |
The signature of the validate function is: | |
Sets the view's controller, checking to see if one has already been set before. | |
Shows the toplevel widget | |
Shows all widgets attached to the toplevel widget | |
Runs show() and runs the GTK+ event loop. |
Class Variable Summary | |
---|---|
NoneType |
controller = None |
NoneType |
domain = None |
NoneType |
gladefile = None |
NoneType |
gladename = None |
NoneType |
toplevel = None |
NoneType |
toplevel_name = None |
list |
widgets = []
|
Method Details |
---|
add_proxy(self, model=None, widgets=None)Add a proxy to this view that automatically update a model when the view changes. Arguments:
|
attach_slave(self, name, slave)Attaches a slaveview to the current view, substituting the widget specified by name. the widget specified *must* be a eventbox; its child widget will be removed and substituted for the specified slaveview's toplevel widget:.-----------------------. the widget that is indicated in the diagram |window/view (self.view)| as placeholder will be substituted for the | .----------------. | slaveview's toplevel. | | eventbox (name)| | .-----------------. | |.--------------.| |slaveview (slave)| | || placeholder <----. |.---------------.| | |'--------------'| \___ toplevel || | '----------------' | ''---------------'| '-----------------------' '-----------------'the original way of attachment (naming the *child* widget instead of the eventbox) is still supported for compatibility reasons but will print a warning. |
connect_multiple(self, widgets, signal, handler, after=False)Connect the same handler to the specified signal for a number of widgets.
|
detach_slave(self, name)Detatch a slave called name from view |
disconnect_autoconnected(self)Disconnect handlers previously connected with autoconnect_signals() |
focus_toplevel(self)Focuses the toplevel widget in the view |
focus_topmost(self, widgets=None)Looks through widgets specified (if no widgets are specified, look through all widgets attached to the view and sets focus to the widget that is rendered in the position closest to the view window's top and left
|
get_glade_adaptor(self)Special init code that subclasses may want to override. |
get_toplevel(self)Returns the toplevel widget in the view |
get_topmost_widget(self, widgets=None, can_focus=False)A real hack; returns the widget that is most to the left and top of the window.
|
get_widget(self, name)Retrieves the named widget from the View |
on_attach(self, parent)Hook function called when attach_slave is performed on slave views. |
on_startup(self)This is a virtual method that can be customized by classes that want to perform additional initalization after a controller has been set for it. If you need this, add this method to your View subclass and BaseController will call it when the controller is set to the proxy. |
register_validate_function(self, function)The signature of the validate function is: def function(is_valid): or, if it is a method: def function(self, is_valid): where the 'is_valid' parameter is True if all the widgets have valid data or False otherwise. |
set_controller(self, controller)Sets the view's controller, checking to see if one has already been set before. |
show(self, *args)Shows the toplevel widget |
show_all(self, *args)Shows all widgets attached to the toplevel widget |
show_and_loop(self, parent=None)Runs show() and runs the GTK+ event loop. If the parent argument is supplied and is a valid view, this view is set as a transient for the parent view
|
Class Variable Details |
---|
controller
|
domain
|
gladefile
|
gladename
|
toplevel
|
toplevel_name
|
widgets
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Oct 19 03:18:14 2006 | http://epydoc.sf.net |