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

Class PlainTool

source code

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

UNIMPLEMENTED_check_layer_type(name)

source code 

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)

source code 

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_ensure_layer(layer_type)

source code 

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)

source code 

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).

UNIMPLEMENTED_add_clear_button()

source code 

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_enable_object_deletion(treeview)

source code 

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*)