Home | Trees | Index | Help |
|
---|
Package gazpacho :: Module widgetadaptor :: Class WidgetAdaptor |
|
BaseWidgetAdaptor
--+ |object
--+ | WidgetAdaptor
ContainerAdaptor
Base class for all widget adaptors
A widget adaptor is the main class of a library plugin. There is a widget adaptor for every widget in the library that needs to do anything special upon certain events in Gazpacho. See this class virtual methods for examples of such special events.
The rest of widgets (e.g. regular widgets) use just an instance of this base class, which provides the basic functionality.
Check gazpacho/widgets/base/base.py for examples of widget adaptors.Method Summary | |
---|---|
Called when a button release event occurs in the widget. | |
Called when creating a widget, it should return an instance of self.type | |
After the widget is created this function is called to put one or more placeholders in it. | |
To get the list of children for a widget, overridable by subclasses | |
get_default(self)
| |
This is responsible for accessing the default value of a property. | |
Return true if it's a toplevel, False otherwise | |
Return a list of signals | |
Build a gadget from a widget | |
Called when the mouse is moved on the widget. | |
Called after all initialization is done in the creation process. | |
Called when the user clicks on a placeholder having a palette icon selected. | |
Prepares the widget to be saved. |
Instance Variable Summary | |
---|---|
cursor : @ivar pixbuf | |
default : default widget as created in gobject.new(). | |
default_child : for packing properties we need to save the default child too | |
editor_name : Name displayed in the editor | |
generic_name : generic_name is used to create default widget names | |
icon : | |
library : | |
NoneType |
name : Optional identifier of adaptor, GType name of type will be used if not
specified |
palette_name : palette_name is used in the palette | |
tooltip : the tooltip is shown in the palette | |
NoneType |
type : GTK type for this widget. |
type_name : type_name is used when saving the xml |
Method Details |
---|
button_release(self, context, widget, event)Called when a button release event occurs in the widget. Note that if the widget is a windowless widget the event is actually produced in its first parent with a gdk window so you will probably want to translate the event coordinates. |
create(self, context, interactive=True)Called when creating a widget, it should return an instance of self.type |
fill_empty(self, context, widget)After the widget is created this function is called to put one or more placeholders in it. Only useful for container widgets |
get_children(self, context, widget)To get the list of children for a widget, overridable by subclasses |
get_default_prop_value(self, prop, parent_type)This is responsible for accessing the default value of a property. And what we consider default is the value assigned to an object immediatelly after it's called gobject.new. parent_name is used for packing properties
|
is_toplevel(self)
|
list_signals(self)
|
load(self, context, widget)Build a gadget from a widget The loading is a two step process: first we get the widget tree from gazpacho.loader or libglade and then we create the gadgets from that widget tree. This function is responsable of the second step of this loading process |
motion_notify(self, context, widget, event)Called when the mouse is moved on the widget. Note that if the widget is a windowless widget the event is actually produced in its first parent with a gdk window so you will probably want to translate the event coordinates. |
post_create(self, context, widget, interactive=True)Called after all initialization is done in the creation process. It takes care of creating the gadgets associated with internal children. It's also the place to set sane defaults, e.g. set the size of a window. |
replace_child(self, context, old_widget, new_widget, parent_widget)Called when the user clicks on a placeholder having a palette icon selected. It replaced a placeholder for the new widget. It's also called in the reverse direction (replacing a widget for a placeholder) when removing a widget or undoing a create operation. |
save(self, context, widget)Prepares the widget to be saved. Basically this mean setting all the gazpacho.widgets for internal children so the filewriter can iterate through them and write them correctly. |
Instance Variable Details |
---|
cursor@ivar pixbuf |
defaultdefault widget as created in gobject.new(). It is used to decide if any property has changed |
default_childfor packing properties we need to save the default child too |
editor_nameName displayed in the editor |
generic_namegeneric_name is used to create default widget names |
icon |
library |
nameOptional identifier of adaptor, GType name of type will be used if not specified
|
palette_namepalette_name is used in the palette |
tooltipthe tooltip is shown in the palette |
typeGTK type for this widget. Used to create widgets with gobject.new()
|
type_nametype_name is used when saving the xml |
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Mon Oct 9 12:40:55 2006 | http://epydoc.sf.net |