Module gwy :: Class PlainTool
[show private | hide private]
[frames | no frames]

Class PlainTool


Method Summary
  UNIMPLEMENTED_add_clear_button()
Adds a `Clear' button to a plain tool.
  UNIMPLEMENTED_check_layer_type(name)
Checks for a required layer type.
  UNIMPLEMENTED_connect_selection(layer_type, bname)
Sets up a plain tool to automatically manage layer selection.
  UNIMPLEMENTED_enable_object_deletion(treeview)
Enables deletion of selection objects by presssing Delete in a tree view diplaying them.
  UNIMPLEMENTED_ensure_layer(layer_type)
Makes sure a plain tool's layer is of the correct type.
  UNIMPLEMENTED_set_selection_key(bname)
Constructs selection key from data key and sets it on the vector layer.

Method Details

UNIMPLEMENTED_add_clear_button()

Adds a `Clear' button to a plain tool.

This button works with automatically managed selection (see PlainTool.connect_selection()). If you want to manage selection yourself add the button with gtk_dialog_add_button().
Returns:
The button widget.

UNIMPLEMENTED_check_layer_type(name)

Checks for a required layer type.

If the layer exists, its GType is returned. If it does not exist, zero is returned and a warning message is added to the tool dialog. In addition, it sets init_failed to True.

Therefore, this function should be called early in tool instance initialization and it should not be called again once it fails.
Parameters:
name - Layer type name (e.g. <literal>"LayerPoint"</literal>). (string)
Returns:
The type of the layer, or 0 on failure.

UNIMPLEMENTED_connect_selection(layer_type, bname)

Sets up a plain tool to automatically manage layer selection.

When layer_type is 0 and bname NULL, plain tool stops automatically managing selection (hopefully).

This method performs PlainTool.ensure_layer() and PlainTool.set_selection_key(), connecting to the selection and making sure the selection field always points to the correct selection object (or is NULL).

The selection_changed method of PlainToolClass is only invoked for a tool instance once this method was called to set up the selection tracking.
Parameters:
layer_type - Layer type. Use PlainTool.check_layer_type() in tool instance initialization to check for layer types. (GType)
bname - Selection key base name, for example <literal>"line"</literal>. (string)

UNIMPLEMENTED_enable_object_deletion(treeview)

Enables deletion of selection objects by presssing Delete in a tree view diplaying them.

Since: 2.7
Parameters:
treeview - A tree view that displays selection objects in order, each row corresponding to one selection object. (GtkTreeView*)

UNIMPLEMENTED_ensure_layer(layer_type)

Makes sure a plain tool's layer is of the correct type.

This is a low-level function, normally you would use PlainTool.connect_selection().
Parameters:
layer_type - Layer type. Use PlainTool.check_layer_type() in tool instance initialization to check for layer types. (GType)

UNIMPLEMENTED_set_selection_key(bname)

Constructs selection key from data key and sets it on the vector layer.

This is a low-level function, normally you would use PlainTool.connect_selection().
Parameters:
bname - Selection key base name, for example <literal>"line"</literal>. (string)
Returns:
The full key (as a layer-owned string).

Generated by Epydoc 2.1 on Tue Dec 30 04:01:41 2008 http://epydoc.sf.net