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.
Appends a View column with the appropriate CellRenderer for the Model column.
The compiler will attempt to instantiate appropriate template code to automatically store user changes in the model. To intercept the user's change and implement non-default logic, or if the compiler can't instantiate appropriate code for your model type, you should use append_column() and connect a signal handler to the CellRenderer.
void Gtk::TreeView::collapse_all
(
)
Recursively collapses all visible, expanded nodes in tree_view .
Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column .
If path is 0, 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 0, 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.
Parameters:
path
A Gtk::TreePath for the row, or 0 to get only horizontal coordinates.
column
A Gtk::TreeViewColumn for the column, or 0 to get only vertical coordiantes.
Fills the bounding rectangle in tree window coordinates for the cell at the row specified by path and the column specified by column .
If path is 0, or points to a path not currently displayed, the y and height fields of the rectangle will be filled with 0. If column is 0, 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 function is only valid if #tree_view is realized.
Parameters:
path
A Gtk::TreePath for the row, or 0 to get only horizontal coordinates.
column
A Gtk::TreeViewColumn for the column, or 0 to get only vertical coordiantes.
Fills visible_rect with the currently-visible region of the buffer, in tree coordinates.
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.
Inserts a View column with the appropriate CellRenderer for the Model column.
The compiler will attempt to instantiate appropriate template code to automatically store user changes in the model. To intercept the user's change and implement non-default logic, or if the compiler can't instantiate appropriate code for your model type, you should use append_column() and connect a signal handler to the CellRenderer.
Moves the alignments of tree view to the position specified by column and path.
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 function 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.
Moves the alignments of tree view to the position specified by column and path.
row_align determines where the row is placed, and col_align determines where 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.
This function 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.
Moves the alignments of tree view to the position specified by column.
The tree does the minimum amount of work to scroll the column onto the screen. This means that the column will be scrolled to the edge closest to it's current position. If the column is currently visible on the screen, nothing is done.
This function only works if the model is set. If the model changes before the tree view is realized, the centered path will be modified to reflect this change.
Moves the alignments of tree view to the position specified by column.
col_align determines where the column is placed, and is expected to be between 0.0 and 1.0. 0.0 means left alignment, 1.0 means right alignment, 0.5 means center.
This function only works if the model is set. If the model changes before the tree view is realized, the centered path will be modified to reflect this change.
The horizontal alignment of the column specified by column.
void 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.
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.
Parameters:
tree_x
X coordinate of new top-left pixel of visible area, or -1.
tree_y
Y coordinate of new top-left pixel of visible area, or -1.
Moves the alignments of tree view to the position specified by path.
The tree does the minimum amount of work to scroll the row onto the screen. This means that the row will be scrolled to the edge closest to it's current position. If the row is currently visible on the screen, nothing is done.
This function 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.
Moves the alignments of tree view to the position specified by path.
row_align determines where the row is placed, and is expected to be between 0.0 and 1.0. 0.0 means top alignment, 1.0 means bottom alignment, 0.5 means center.
This function 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.
Parameters:
path
The path of the row to move to.
row_align
The vertical alignment of the row specified by path.
Sets the current keyboard focus to be at path , and selects it.
This is useful when you want to focus the user's attention on a particular row. If focus_column is not 0, then focus is given to the column specified by it. If focus_column and focus_cell are not 0, 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 function is often followed by gtk_widget_grab_focus ( tree_view ) in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.
Sets the current keyboard focus to be at path , and selects it.
This is useful when you want to focus the user's attention on a particular row. If focus_column is not 0, 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 ( tree_view ) in order to give keyboard focus to the widget. Please note that editing can only happen when the widget is realized.
If the tree_view already has a model set, it will remove it before setting the new model. If model is 0, then it will unset the old model.
Parameters:
model
The model.
void Gtk::TreeView::set_reorderable
(
bool
reorderable = true
)
This function is a convenience function to allow you to reorder models that support the Gtk::DragSourceIface and the Gtk::DragDestIface.
Both Gtk::TreeStore and Gtk::ListStore support these. 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 function 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.
Parameters:
reorderable
true, if the tree can be reordered.
void Gtk::TreeView::set_rules_hint
(
bool
setting = true
)
This function tells GTK+ that the user interface for your application requires users to read across tree rows and associate cells with one another.
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 function 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).
Parameters:
setting
true if the tree requires reading across rows.
void Gtk::TreeView::set_search_column
(
int
column
)
Sets column as the column where the interactive search code should search in.
Additionally, turns on interactive searching. Note that column refers to a column of the model.