Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::Gtk::TreeView Class Reference

A GtkTreeView C++ wrapper class. More...

#include <xfc/gtk/treeview.hh>

Inheritance diagram for Xfc::Gtk::TreeView:

Xfc::Gtk::Container Xfc::Gtk::Widget Xfc::Gtk::Object Xfc::Atk::Implementor Xfc::G::Object Xfc::G::TypeInterface Xfc::G::TypeInstance Xfc::G::TypeInstance Xfc::Trackable Xfc::Trackable List of all members.

Signal Prototypes

Public Types

Public Member Functions

Accessors
Methods
Signal Proxies

Detailed Description

A GtkTreeView C++ wrapper class.

TreeView is a widget that can display any object that implements the TreeModel interface.

To use TreeView in your application you only need to include two header files <xfc/gtk/treeview.hh> and either <xfc/gtk/liststore.hh> or <xfc/gtk/treestore.hh>. These header files include all the other header files that TreeView needs.

See also: the TreeView Widget HOWTO and example.


Member Typedef Documentation

typedef sigc::slot<bool, TreeView&, TreeViewColumn&, TreeViewColumn*, TreeViewColumn*> Xfc::Gtk::TreeView::ColumnDropSlot

Signature of the callback slot for determining whether a column can be dropped in a particular spot (as determined by prev_column and next_column).

Example: Method signature for ColumnDropSlot.

< bool method(TreeView& tree_view, TreeViewColumn& column, TreeViewColumn *prev_column, TreeViewColumn *next_column);
<
< // tree_view: A TreeView.
< // column: The TreeViewColumn being dragged.
< // prev_column: A TreeViewColumn on one side of column.
< // next_column: A TreeViewColumn on the other side of column.
< // return: true if column can be dropped in this spot.
<
In left to right locales, prev_column is on the left of the potential drop spot, and next_column is on the right. In right to left mode, this is reversed. This slot should return true if the spot is a valid drop spot. Please note that returning true does not actually indicate that the column drop was made, but is meant only to indicate a possible drop spot to the user.

typedef sigc::slot<void, TreeView&, const TreePath&> Xfc::Gtk::TreeView::MappingSlot

Signature of the callback slot to be called on each expanded row.

Example: Method signature for MappingSlot.

< void method(TreeView& tree_view, const TreePath& path);
<
< // tree_view: The TreeView.
< // path: The path being expanded.
<

typedef sigc::slot<bool, const TreeModel&, int, const String&, const TreeIter&> Xfc::Gtk::TreeView::SearchEqualSlot

Signature of the callback slot to be called during an interactvie search.

Example: Method signature for SearchEqualSlot.

< bool method(const TreeModel& model, int column, const String& key, const TreeIter& iter);
<
< // model: The TreeModel.
< // column: The coloumn identifier.
< // key: The string being search for.
< // iter: A valid TreeIter for the row being searched.
< // return: <EM>false</EM> to stop the search, <EM>true</EM> to continue.
<

typedef sigc::slot<bool, const TreeModel&, const TreeIter&> Xfc::Gtk::TreeView::RowSeparatorSlot

Signature of the callback slot called to determine whether the row pointed to by iter should be rendered as a separator.

Example: Method signature for RowSeparatorSlot.

< void method(const TreeModel& model, const TreeIter& iter);
< // model: The TreeModel.
< // iter: A TreeIter pointing to a row in the model. 
< // return: <EM>true</EM> if the row is a separator.   
<

A common way to implement this is to have a boolean column in the model, whose values the RowSeparatorSlot returns.


Constructor & Destructor Documentation

Xfc::Gtk::TreeView::TreeView ( GtkTreeView *  tree_view,
bool  owns_reference = false 
) [explicit, protected]

Construct a new TreeView from an existing GtkTreeView.

Parameters:
tree_view A pointer to a GtkTreeView.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The tree_view can be a newly created GtkTreeView or an existing GtkTreeView (see G::Object::Object).

Xfc::Gtk::TreeView::TreeView ( TreeModel model  )  [explicit]

Construct a new tree view with the model initialized to model.

Parameters:
model The model.

Xfc::Gtk::TreeView::TreeView ( GtkTreeView *  tree_view,
bool  owns_reference = false 
) [explicit, protected]

Construct a new TreeView from an existing GtkTreeView.

Parameters:
tree_view A pointer to a GtkTreeView.
owns_reference Set false if the initial reference count is floating, set true if it's not.
The tree_view can be a newly created GtkTreeView or an existing GtkTreeView (see G::Object::Object).

Xfc::Gtk::TreeView::TreeView ( TreeModel model  )  [explicit]

Construct a new tree view with the model initialized to model.

Parameters:
model The model.


Member Function Documentation

TreeModel* Xfc::Gtk::TreeView::get_model (  )  const

Returns the model the tree view is based on.

Returns:
The model, or null if the model is currently unset.

Adjustment* Xfc::Gtk::TreeView::get_hadjustment (  )  const

Gets the Adjustment currently being used for the horizontal aspect.

Returns:
An Adjustment object, or null if none is currently being used.

Adjustment* Xfc::Gtk::TreeView::get_vadjustment (  )  const

Gets the Adjustment currently being used for the vertical aspect.

Returns:
An Adjustment object, or null if none is currently being used.

bool Xfc::Gtk::TreeView::get_headers_visible (  )  const

Returns true if the headers on the tree view are visible.

Returns:
Whether the headers are visible or not.

TreeViewColumn* Xfc::Gtk::TreeView::get_column ( int  position  )  const

Gets the TreeViewColumn at the given position in the tree view.

Parameters:
position The position of the column, counting from 0.
Returns:
The TreeViewColumn, or null if the position is outside the range of columns.

bool Xfc::Gtk::TreeView::get_columns ( std::vector< TreeViewColumn * > &  columns  )  const

Returns a list of all the columns currently in tree_view.

Parameters:
columns A reference to a vector of TreeViewcolumn* to hold the list of columns.
Returns:
true if columns is not empty.

TreeViewColumn* Xfc::Gtk::TreeView::get_expander_column (  )  const

Returns the column that is the current expander column, that is, the column that has the expander arrow drawn next to it.

Returns:
The expander column.

bool Xfc::Gtk::TreeView::row_expanded ( const TreePath path  )  const

Returns true if the node pointed to by path is expanded in the tree view.

Parameters:
path A TreePath to test expansion state.
Returns:
true if path is expanded.

bool Xfc::Gtk::TreeView::get_reorderable (  )  const

Retrieves whether the user can reorder the tree via drag-and-drop (see set_reorderable()).

Returns:
true if the tree can be reordered.

void Xfc::Gtk::TreeView::get_cursor ( Pointer< TreePath > *  path,
TreeViewColumn **  focus_column 
) const

Fills in path and focus_column with the current path and focus column.

Parameters:
path A smart pointer to be filled with the current cursor path, or null.
focus_column A pointer to be filled with the current focus column, or null.
If the cursor isn't currently set, then '*path' will be null. If no column currently has the focus, then '*focus_column' will be null.

Gdk::Window* Xfc::Gtk::TreeView::get_bin_window (  )  const

Returns the window that tree view renders to.

Returns:
A Gdk::Window, or null when tree_view hasn't been realized yet.
This is used primarily to compare to event->window to confirm that the event on the tree view is on the right window.

bool Xfc::Gtk::TreeView::get_path_at_pos ( int  x,
int  y,
Pointer< TreePath > *  path,
TreeViewColumn **  column,
int *  cell_x,
int *  cell_y 
) const

Finds the path at the point (x, y), relative to widget coordinates.

Parameters:
x The x position to be identified.
y The y position to be identified.
path A smart pointer to a TreePath pointer to be filled in, or null.
column A pointer to a TreeViewColumn pointer to be filled in, or null.
cell_x A pointer where the X coordinate relative to the cell can be placed, or null.
cell_y A pointer where the Y coordinate relative to the cell can be placed, or null.
Returns:
true if a row exists at that coordinate.
x and y are relative to an event's coordinates and must come from an event on the tree view only where event->window == get_bin_window(). It is primarily for things like popup menus. If path is non-null, then it will be filled with the TreePath at that point. If column is non-null, then it will be filled with the column at that point. cell_x and cell_y return the coordinates relative to the cell background (i.e. the background_area passed to Gtk::CellRenderer::render()). This method is only meaningful if the tree view is realized.

void Xfc::Gtk::TreeView::get_cell_area ( const TreePath path,
const TreeViewColumn column,
Gdk::Rectangle rectangle 
) const

Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column.

Parameters:
path A TreePath for the row, or null to get only horizontal coordinates.
column A TreeViewColumn for the column, or null to get only vertical coordinates.
rectangle The rectangle to fill with the cell area.
If path is null, or points to a path not currently displayed, the y and height fields of the rectangle will be filled with 0. If column is null, the x and width fields will be filled with 0. The sum of all cell rects does not cover the entire tree; there are extra pixels in between rows, for example. The returned rectangle is equivalent to the cell_area passed to Gtk::CellRenderer::render(). This method is only valid if the tree view is realized.

Gdk::Rectangle Xfc::Gtk::TreeView::get_cell_area ( const TreePath path,
const TreeViewColumn column 
) const

Returns a rectangle filled with the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column.

Parameters:
path A TreePath for the row, or null to get only horizontal coordinates.
column A TreeViewColumn for the column, or null to get only vertical coordinates.
Returns:
A rectangle filled with the cell area.
If path is null, or points to a path not currently displayed, the y and height fields of the rectangle will be filled with 0. If column is null, the x and width fields will be filled with 0. The sum of all cell rects does not cover the entire tree; there are extra pixels in between rows, for example. The returned rectangle is equivalent to the cell_area passed to Gtk::CellRenderer::render(). This method is only valid if the tree view is realized.

void Xfc::Gtk::TreeView::get_background_area ( const TreePath path,
const TreeViewColumn column,
Gdk::Rectangle rectangle 
) const

Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column.

Parameters:
path A TreePath for the row, or null to get only horizontal coordinates.
column A TreeViewColumn for the column, or null to get only vertical coordinates.
rectangle The rectangle to fill with cell background area.
If path is null, or points to a node not found in the tree, the y and height fields of the rectangle will be filled with 0. If column is null, the x and width fields will be filled with 0. The returned rectangle is equivalent to the background_area passed to Gtk::CellRenderer::render(). These background areas tile to cover the entire tree window (except for the area used for header buttons). Contrast with the cell_area, returned by get_cell_area(), which returns only the cell itself, excluding surrounding borders and the tree expander area.

Gdk::Rectangle Xfc::Gtk::TreeView::get_background_area ( const TreePath path,
const TreeViewColumn column 
) const

Returns a rectangle filled with the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column.

Parameters:
path A TreePath for the row, or null to get only horizontal coordinates.
column A TreeViewColumn for the column, or null to get only vertical coordinates.
Returns:
A rectangle filled with cell background area.
If path is null, or points to a node not found in the tree, the y and height fields of the rectangle will be filled with 0. If column is null, the x and width fields will be filled with 0. The returned rectangle is equivalent to the background_area passed to Gtk::CellRenderer::render(). These background areas tile to cover the entire tree window (except for the area used for header buttons). Contrast with the cell_area, returned by get_cell_area(), which returns only the cell itself, excluding surrounding borders and the tree expander area.

void Xfc::Gtk::TreeView::get_visible_rect ( Gdk::Rectangle visible_rect  )  const

Fills visible_rect with the currently visible region of the view, in tree coordinates.

Parameters:
visible_rect The rectangle to fill.
Convert to widget coordinates with tree_to_widget_coords(). Tree coordinates start at (0,0) for row 0 of the tree, and cover the entire scrollable area of the tree.

Gdk::Rectangle Xfc::Gtk::TreeView::get_visible_rect (  )  const

Returns a rectangle filled with the currently visible region of the view, in tree coordinates.

Returns:
The rectangle to fill with the visible region.
Convert to widget coordinates with tree_to_widget_coords(). Tree coordinates start at (0,0) for row 0 of the tree, and cover the entire scrollable area of the tree.

bool Xfc::Gtk::TreeView::get_rules_hint (  )  const

Gets the setting set by set_rules_hint().

Returns:
true if rules are useful for the user of this tree.

void Xfc::Gtk::TreeView::get_drag_dest_row ( Pointer< TreePath > *  path,
TreeViewDropPosition pos 
) const

Gets the path and/or drop position type of a row.

Parameters:
path A smart pointer to a TreePath to be filled in, or null.
pos The return location for the drop position type, or null.

bool Xfc::Gtk::TreeView::get_dest_row_at_pos ( int  drag_x,
int  drag_y,
Pointer< TreePath > *  path,
TreeViewDropPosition pos 
) const

Finds the path and drop position type for the coordinates (drag_x, drag_y).

Parameters:
drag_x The X coordinate.
drag_y The Y coordinate.
path A smart pointer to a TreePath to be filled in, or null.
pos The return location for the drop position type, or null.
Returns:
true if a row exists at the coordinates.
This method is provided to allow a custom drag-and-drop implementation. See get_path_at_pos().

bool Xfc::Gtk::TreeView::get_enable_search (  )  const

Returns whether or not the tree allows interactive searching.

Returns:
Whether or not to let the user search interactively.

int Xfc::Gtk::TreeView::get_search_column (  )  const

Gets the column searched on by the interactive search code.

Returns:
The column the interactive search code searches in.

bool Xfc::Gtk::TreeView::get_fixed_height_mode (  )  const

Determines whether fixed height mode is turned on for the tree view.

Returns:
true if the tree view is in fixed height mode.

bool Xfc::Gtk::TreeView::get_hover_selection (  )  const

Determines whether hover selection mode is turned on for the tree view.

Returns:
true if the tree view is in hover selection mode.

bool Xfc::Gtk::TreeView::get_hover_expand (  )  const

Determines whether hover expansion mode is turned on for the tree view.

Returns:
true if the tree view is in hover expansion mode.

void Xfc::Gtk::TreeView::set_model ( TreeModel model  ) 

Sets the model for the tree view.

Parameters:
model The model.
If the tree view already has a model set, it will remove it before setting the new model. If model is null, then it will unset the old model.

void Xfc::Gtk::TreeView::set_hadjustment ( Adjustment adjustment  ) 

Sets the Adjustment for the current horizontal aspect.

Parameters:
adjustment The Adjustment to set, or null.

void Xfc::Gtk::TreeView::set_vadjustment ( Adjustment adjustment  ) 

Sets the Adjustment for the current vertical aspect.

Parameters:
adjustment The Adjustment to set, or null.

void Xfc::Gtk::TreeView::set_headers_visible ( bool  headers_visible  ) 

Sets the visibility state of the headers.

Parameters:
headers_visible true if the headers are visible.

void Xfc::Gtk::TreeView::set_headers_clickable ( bool  setting  ) 

Allow the column title buttons to be clicked.

Parameters:
setting true if the columns are clickable.

int Xfc::Gtk::TreeView::append_column ( TreeViewColumn column  ) 

Appends column to the list of columns.

Parameters:
column The TreeViewColumn to add.
Returns:
The number of columns in the tree view after appending.

int Xfc::Gtk::TreeView::append_column ( const String title,
CellRenderer cell,
const CellColumnAttributes attributes 
)

Creates a new TreeViewColumn and appends it to the end of the list of columns.

Parameters:
title The title to set the header to.
cell The CellRenderer.
attributes The tree column attributes.
Returns:
The number of columns in the tree view after insertion.
The column is initialized with the attributes given.

int Xfc::Gtk::TreeView::append_column ( const String title,
CellRenderer cell,
const CellDataSlot data 
)

Convenience method that appends a new column to the tree view with the given cell renderer and a TreeViewColumn::CellDataSlot to set cell renderer attributes.

Parameters:
title The column title.
cell The cell renderer for column.
data The callback slot to set attributes of cell renderer.
Returns:
The number of columns in the tree view post-insert
See also Gtk::TreeViewColumn::set_cell_data_func(), Gtk::TreeViewColumn::pack_start().

int Xfc::Gtk::TreeView::insert_column ( TreeViewColumn column,
int  position 
)

This inserts the column into the tree view at position.

Parameters:
column The TreeViewColumn to be inserted.
position The position to insert column in.
Returns:
The number of columns in the tree view after insertion.
If position is -1, then the column is appended to the end.

int Xfc::Gtk::TreeView::insert_column ( int  position,
const String title,
CellRenderer cell,
const CellColumnAttributes attributes 
)

Creates a new TreeViewColumn and inserts it into the tree view at position.

Parameters:
position The position to insert the new column in.
title The title to set the header to.
cell The CellRenderer.
attributes The tree column attributes to set.
Returns:
The number of columns in the tree view after insertion.
If position is -1, then the newly created column is appended to the end. The column is initialized with the attributes given.

int Xfc::Gtk::TreeView::insert_column ( int  position,
const String title,
CellRenderer cell,
const CellDataSlot data 
)

Convenience method that inserts a new column into the TreeView with the given cell renderer and a TreeViewColumn::CellDataSlot to set cell renderer attributes.

Parameters:
position The position to insert, or -1 to append.
title The column title.
cell The cell renderer for column.
data The callback slot to set attributes of cell renderer.
Returns:
The number of columns in the tree view post-insert
See also Gtk::TreeViewColumn::set_cell_data_func(), Gtk::TreeViewColumn::pack_start().

int Xfc::Gtk::TreeView::remove_column ( TreeViewColumn column  ) 

Removes column from the tree view.

Parameters:
column The TreeViewColumn to remove.
Returns:
The number of columns in the tree view after removing.

void Xfc::Gtk::TreeView::move_column_after ( TreeViewColumn column,
TreeViewColumn base_column 
)

Moves column to be after to base_column.

Parameters:
column The TreeViewColumn to be moved.
base_column The TreeViewColumn to be moved relative to, or null.
If base_column is null, then column is placed in the first position.

void Xfc::Gtk::TreeView::set_expander_column ( TreeViewColumn column  ) 

Sets the column to draw the expander arrow at.

Parameters:
column The column to draw the expander arrow at, or null.
It must be in the tree view. If column is null, then the expander arrow is always at the first visible column.

void Xfc::Gtk::TreeView::set_column_drag_function ( const ColumnDropSlot drop  ) 

Sets a user callback slot for determining where a column may be dropped when dragged.

Parameters:
drop A callback slot to determine which columns are reorderable, or null.
This slot is called on every column pair in turn at the beginning of a column drag to determine where a drop can take place. The arguments passed to the slot method are: the tree view, the TreeViewColumn being dragged and the two TreeViewColumns determining the drop spot. If either of the TreeViewColumn arguments for the drop spot are null, then they indicate an edge. If slot is set to be null, then tree view reverts to the default behavior of allowing all columns to be dropped everywhere.

void Xfc::Gtk::TreeView::scroll_to_point ( int  tree_x,
int  tree_y 
)

Scrolls the tree view such that the top-left corner of the visible area is tree_x, tree_y, where tree_x and tree_y are specified in tree window coordinates.

Parameters:
tree_x The X coordinate of new top-left pixel of visible area, or -1.
tree_y The Y coordinate of new top-left pixel of visible area, or -1.
The tree view must be realized before this function is called. If it isn't, you probably want to be using scroll_to_cell(). If either tree_x or tree_y are -1, then that direction isn't scrolled.

void Xfc::Gtk::TreeView::scroll_to_cell ( const TreePath path,
const TreeViewColumn column 
)

Moves the alignments of the tree view to the position specified by column and path.

Parameters:
path The path of the row to move to, or null.
column The TreeViewColumn to move horizontally to, or null.
If column is null, then no horizontal scrolling occurs. Likewise, if path is null no vertical scrolling occurs. At a minimum, one of column or path need to be non-null. This method has no alignment arguments. Instead the tree does the minimum amount of work to scroll the cell onto the screen. This means that the cell will be scrolled to the edge closest to it's current position. If the cell is currently visible on the screen, nothing is done.

This method only works if the model is set, and path is a valid row on the model. If the model changes before the tree view is realized, the centered path will be modified to reflect this change.

void Xfc::Gtk::TreeView::scroll_to_cell ( const TreePath path,
const TreeViewColumn column,
float  row_align,
float  col_align 
)

Moves the alignments of the tree view to the position specified by column and path.

Parameters:
path The path of the row to move to, or null.
column The TreeViewColumn to move horizontally to, or null.
row_align The vertical alignment of the row specified by path.
col_align The horizontal alignment of the column specified by column.
If column is null, then no horizontal scrolling occurs. Likewise, if path is null no vertical scrolling occurs. At a minimum, one of column or path need to be non-null. row_align determines where the row is placed, and col_align determines where the column is placed. Both are expected to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center. If the cell is currently visible on the screen, nothing is done.

This method only works if the model is set, and path is a valid row on the model. If the model changes before the tree view is realized, the centered path will be modified to reflect this change.

void Xfc::Gtk::TreeView::row_activated ( TreePath path,
TreeViewColumn column 
)

Activates the cell determined by path and column.

Parameters:
path The TreePath to be activated.
column The TreeViewColumn to be activated.

void Xfc::Gtk::TreeView::expand_to_path ( const TreePath path  ) 

Expands the row at path.

Parameters:
path The path to a row.
This will also expand all parent rows of path as necessary.

bool Xfc::Gtk::TreeView::expand_row ( const TreePath path,
bool  open_all 
)

Opens the row specified by path so its children are visible.

Parameters:
path The path to a row.
open_all Whether to recursively expand, or just expand the immediate children.
Returns:
true if the row existed and had children.

bool Xfc::Gtk::TreeView::collapse_row ( const TreePath path  ) 

Collapses the row specified by path hiding its child rows, if they exist.

Parameters:
path The path to a row in the tree view.
Returns:
true if the row was collapsed.

void Xfc::Gtk::TreeView::map_expanded_rows ( const MappingSlot map  ) 

Calls the map slot on all expanded rows.

Parameters:
map The callback slot to be called.

void Xfc::Gtk::TreeView::set_reorderable ( bool  reorderable  ) 

This function is a convenience function to allow you to reorder models that support the drag-and-drop interface; both TreeStore and ListStore support these.

Parameters:
reorderable true if the tree can be reordered.
If reorderable is true, then the user can reorder the model by dragging and dropping rows. The developer can listen to these changes by connecting to the model's signals. This method does not give you any degree of control over the order, any reorderering is allowed. If more control is needed, you should probably handle drag and drop manually.

void Xfc::Gtk::TreeView::set_cursor ( const TreePath path,
TreeViewColumn focus_column,
bool  start_editing = false 
)

Sets the current keyboard focus to be at path, and selects it.

Parameters:
path A TreePath.
focus_column A TreeViewColumn, or null.
start_editing true if the specified cell should start being edited.
This is useful when you want to focus the user's attention on a particular row. If focus_column is not null, then focus is given to the column specified by it. Additionally, if focus_column is specified, and start_editing is true, then editing should be started in the specified cell. This function is often followed by Gtk::Widget::grab_focus() in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.

void Xfc::Gtk::TreeView::set_cursor_on_cell ( const TreePath path,
TreeViewColumn focus_column,
CellRenderer focus_cell,
bool  start_editing = false 
)

Sets the current keyboard focus to be at path, and selects it.

Parameters:
path A TreePath.
focus_column A TreeViewColumn, or null.
focus_cell A CellRenderer, or null.
start_editing Set true if the specified cell should start being edited.
This is useful when you want to focus the user's attention on a particular row. If focus_column is not null, then focus is given to the column specified by it. If focus_column and focus_cell are not null, and focus_column contains 2 or more editable or activatable cells, then focus is given to the cell specified by focus_cell. Additionally, if focus_column is specified, and start_editing is true, then editing should be started in the specified cell. This method is often followed by Gtk::Widget::grab_focus() in order to give keyboard focus to the tree view. Please note that editing can only happen when the widget is realized.

void Xfc::Gtk::TreeView::widget_to_tree_coords ( int  wx,
int  wy,
int *  tx,
int *  ty 
) const

Converts widget coordinates to coordinates for the tree window (the full scrollable area of the tree).

Parameters:
wx The widget X coordinate.
wy The widget Y coordinate.
tx The return location for tree X coordinate.
ty The return location for tree Y coordinate.

void Xfc::Gtk::TreeView::tree_to_widget_coords ( int  tx,
int  ty,
int *  wx,
int *  wy 
) const

Converts tree coordinates (coordinates in the full scrollable area of the tree) to widget coordinates.

Parameters:
tx The tree X coordinate.
ty The tree Y coordinate.
wx The return location for widget X coordinate.
wy The return location for widget Y coordinate.

void Xfc::Gtk::TreeView::set_rules_hint ( bool  setting  ) 

This method tells GTK+ that the user interface for your application requires users to read across tree rows and associate cells with one another.

Parameters:
setting true if the tree requires reading across rows.
By default, GTK+ will then render the tree with alternating row colors. Do not use it just because you prefer the appearance of the ruled tree; that's a question for the theme. Some themes will draw tree rows in alternating colors even when rules are turned off, and users who prefer that appearance all the time can choose those themes. You should call this method only as a semantic hint to the theme engine that your tree makes alternating colors useful from a functional standpoint (since it has lots of columns, generally).

void Xfc::Gtk::TreeView::enable_model_drag_source ( Gdk::ModifierTypeField  start_button_mask,
const std::vector< TargetEntry > &  targets,
Gdk::DragActionField  actions 
)

Sets up the tree view so that GTK+ will start a drag operation when the user clicks and drags on the tree view.

Parameters:
start_button_mask The bitmask of buttons that can start the drag.
targets The TargetEntrys for the targets the drag will support.
actions The bitmask of possible actions for a drag from this widget.
This method is provided for manual drag-and-drop. TreeView already provides simple drag-and-drop (see set_reorderable()).

void Xfc::Gtk::TreeView::enable_model_drag_dest ( const std::vector< TargetEntry > &  targets,
Gdk::DragActionField  actions 
)

Sets the tree view as a potential drop destination.

Parameters:
targets A vector of TargetEntry indicating the drop types that this tree view will accept.
actions A bitmask of possible actions for a drop onto this widget.
The targets and actions fields only are used if DEST_DEFAULT_MOTION or DEST_DEFAULT_DROP are given.

void Xfc::Gtk::TreeView::unset_rows_drag_dest (  ) 

Clears information about a drop destination set with enable_model_drag_dest().

The tree view will no longer receive notification of drags.

void Xfc::Gtk::TreeView::set_drag_dest_row ( const TreePath path,
TreeViewDropPosition  pos 
)

Sets where a dropped row goes.

Parameters:
path A TreePath to the destination row.
pos One of the position values in the TreeViewDropPosition enumeration.

Pointer<Gdk::Pixmap> Xfc::Gtk::TreeView::create_row_drag_icon ( const TreePath path  ) 

Creates a Gdk::Pixmap representation of the row at path; this image is used for a drag icon.

Parameters:
path A TreePath in tree_view.
Returns:
A smart pointer to a newly-allocated pixmap of the drag icon.

void Xfc::Gtk::TreeView::set_enable_search ( bool  enable_search  ) 

If enable_search is set, then the user can type in text to search through the tree interactively.

Parameters:
enable_search true if the user can search interactively.

void Xfc::Gtk::TreeView::set_search_column ( int  column  ) 

Sets column as the column where the interactive search code should search in.

Parameters:
column The column of the model to search in.
Additionally, turns on interactive searching. Note that column refers to a column of the model.

void Xfc::Gtk::TreeView::set_fixed_height_mode ( bool  enable  ) 

Enables or disables the fixed height mode of the tree view.

Parameters:
enable Set to true to enable fixed height mode.
Fixed height mode speeds up Gtk::TreeView by assuming that all rows have the same height. Only enable this option if all rows are the same height and all columns are of type Gtk::TREE_VIEW_COLUMN_FIXED.

void Xfc::Gtk::TreeView::set_hover_selection ( bool  hover  ) 

Enables or disables the hover selection mode of the tree view.

Parameters:
hover true to enable hover selection mode.
Hover selection makes the selected row follow the pointer. Currently, this works only for the selection modes Gtk::SELECTION_SINGLE and Gtk_SELECTION_BROWSE.

void Xfc::Gtk::TreeView::set_hover_expand ( bool  expand  ) 

Enables of disables the hover expansion mode of the tree view.

Parameters:
expand Set to true to enable hover expansion mode
Hover expansion makes rows expand or collaps if the pointer moves over them.

void Xfc::Gtk::TreeView::set_row_separator_func ( const RowSeparatorSlot slot  ) 

Sets the row separator function, which is used to determine whether a row should be drawn as a separator.

Parameters:
slot A RowSeparatorSlot.

void Xfc::Gtk::TreeView::unset_row_separator_func (  ) 

Unsets the row separator function set by set_row_separator_func().

After calling this method no separators will be drawn. This is the default value so you only need to call this method if you previously called set_row_separator_func().

void Xfc::Gtk::TreeView::set_search_equal_func ( const SearchEqualSlot search_equal  ) 

Sets the compare slot for the interactive search capabilities.

Parameters:
search_equal The compare slot to call during the search.


Member Data Documentation

const SetScrollAdjustmentsSignalType Xfc::Gtk::TreeView::set_scroll_adjustments_signal [static, protected]

Set scroll adjustments signal (see signal_set_scroll_adjustments()).

Calls a slot with the signature:

< void function(Adjustment *hadjustment, Adjustment *vadjustment);
< // hadjustment: The horizontal adjustment.
< // vadjustment: The vertical adjustment.
<

const RowActivatedSignalType Xfc::Gtk::TreeView::row_activated_signal [static, protected]

Row activated signal (see signal_row_activated()).

Calls a slot with the signature:

< void function(const TreePath& path, TreeViewColumn& column);
< // path: The TreePath being activated.
< // column: The TreeViewColumn being activated.
<

const TestExpandRowSignalType Xfc::Gtk::TreeView::test_expand_row_signal [static, protected]

Test expand row signal (see signal_test_expand_row()).

Calls a slot with the signature:

< bool function(const TreeIter& iter, const TreePath& path);
< // iter: A valid iterator pointing to path.
< // path: The path to the row being checked.
< // return: true if the row has chil rows and can be expanded.
<

const TestCollapseRowSignalType Xfc::Gtk::TreeView::test_collapse_row_signal [static, protected]

Test collapse row signal (see signal_test_collapse_row()).

Calls a slot with the signature:

< bool function(const TreeIter& iter, const TreePath& path);
< // iter: A valid iterator pointing to path.
< // path: The path to the row being checked.
< // return: true if the row has child rows that are visible and can be collapsed.
<

const RowExpandedSignalType Xfc::Gtk::TreeView::row_expanded_signal [static, protected]

Row expanded signal (see signal_row_expanded()).

Calls a slot with the signature:

< void function(const TreeIter& iter, const TreePath& path);
< // iter: A valid iterator pointing to path.
< // path: The path to the row being expanded.
<

const RowCollapsedSignalType Xfc::Gtk::TreeView::row_collapsed_signal [static, protected]

Row collapsed signal (see signal_row_collapsed()).

Calls a slot with the signature:

< void function(const TreeIter& iter, const TreePath& path);
< // iter: A valid iterator pointing to path.
< // path: The path to the row being collapsed.
<

const ColumnsChangedSignalType Xfc::Gtk::TreeView::columns_changed_signal [static, protected]

Columns changed signal (see signal_columns_changed()).

Calls a slot with the signature:

< void function();
<

const CursorChangedSignalType Xfc::Gtk::TreeView::cursor_changed_signal [static, protected]

Cursor changed signal (see signal_cursor_changed()).

Calls a slot with the signature:

< void function();
<


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3