# Gtk::ListViewText Class Reference
[Widgets, Container Widgets, TreeView Classes]

A simple listbox which presents some lines of information in columns and lets the user select some of them. More...

Inherits Gtk::TreeView.

Collaboration diagram for Gtk::ListViewText:
[legend]

List of all members.

## Classes

class | TextModelColumns

## Public Types

typedef std::vector< int > | SelectionList

## Public Member Functions

| ListViewText (guint columns_count, bool editable=false, Gtk::SelectionMode mode=Gtk::SELECTION_SINGLE)
virtual | ~ListViewText ()
void | set_column_title (guint column, const Glib::ustring& title)
| Adds a title to column column.
Glib::ustring | get_column_title (guint column) const
| Gets the title of column column.
guint | append_text (const Glib::ustring& column_one_value=Glib::ustring())
| Add a new row at the end of the list.
void | prepend_text (const Glib::ustring& column_one_value=Glib::ustring())
| Insert a new row at the beginning of the list.
void | insert_text (guint row, const Glib::ustring& column_one_value=Glib::ustring())
| Insert a new row at an arbitrary position in the list.
void | clear_items ()
| Discard all row:.
Glib::ustring | get_text (guint row, guint column=0) const
| Obtain the value of an existing cell from the list.
void | set_text (guint row, guint column, const Glib::ustring&value)
| Change an existing value of cell of the list.
void | set_text (guint row, const Glib::ustring&value)
| Change an existing value of a column 0 of a row of the list.
guint | size () const
guint | get_num_columns () const
SelectionList | get_selected ()
| Returns a vector of the indexes of the selected rows.

## Protected Attributes

Glib::RefPtr< Gtk::ListStore > | m_model
TextModelColumns | m_model_columns

## Detailed Description

A simple listbox which presents some lines of information in columns and lets the user select some of them.

This is a convenience class, based on Gtk::TreeView, which allows only text values and does not allow child items. In most cases you will actually need the functionality offered by a real Gtk::TreeView with your own type-safe Gtk::TreeModel::ColumnRecord.

Since gtkmm 2.10:

## Member Typedef Documentation

typedef std::vector<int> Gtk::ListViewText::SelectionList

## Constructor & Destructor Documentation

Gtk::ListViewText::ListViewText | ( | guint | columns_count,
|  | bool | editable = `false`,
|  | Gtk::SelectionMode | mode = `Gtk::SELECTION_SINGLE` |
| ) |  |  |

virtual Gtk::ListViewText::~ListViewText | ( |  | ) | `[virtual]`

## Member Function Documentation

guint Gtk::ListViewText::append_text | ( | const Glib::ustring & | column_one_value = `Glib::ustring()` | ) |

Add a new row at the end of the list.

Parameters:

  | column_one_value | the new text for the new row, column 0

Returns:
  the number of the row added

void Gtk::ListViewText::clear_items | ( |  | ) |

Discard all row:.

Glib::ustring Gtk::ListViewText::get_column_title | ( | guint | column | ) | const

Gets the title of column column.

Parameters:

  | column | the column number.

Returns:
  the title of column column.

guint Gtk::ListViewText::get_num_columns | ( |  | ) | const

Returns:
  the number of columns in the listbox

SelectionList Gtk::ListViewText::get_selected | ( |  | ) |

Returns a vector of the indexes of the selected rows.

Returns:
  a SelectionList with the selection results

Glib::ustring Gtk::ListViewText::get_text | ( | guint | row,
|  | guint | column = `0` |
| ) |  |  | const

Obtain the value of an existing cell from the list.

Parameters:

  | row | the number of the row in the listbox.
  | column | the number of the column in the row.

Returns:
  the value of that cell, if it exists.

void Gtk::ListViewText::insert_text | ( | guint | row,
|  | const Glib::ustring & | column_one_value = `Glib::ustring()` |
| ) |  |  |

Insert a new row at an arbitrary position in the list.

Parameters:

  | row | The row number
  | column_one_value | the new text for the new row, column 0

void Gtk::ListViewText::prepend_text | ( | const Glib::ustring & | column_one_value = `Glib::ustring()` | ) |

Insert a new row at the beginning of the list.

Parameters:

  | column_one_value | the new text for the new row, column 0

void Gtk::ListViewText::set_column_title | ( | guint | column,
|  | const Glib::ustring & | title |
| ) |  |  |

Adds a title to column column.

Parameters:

  | column | the column number.
  | title | the title for column column.

void Gtk::ListViewText::set_text | ( | guint | row,
|  | const Glib::ustring & | value |
| ) |  |  |

Change an existing value of a column 0 of a row of the list.

Parameters:

  | row | the number of the row in the list.
  | value | the new contents of column 0 of the row.

void Gtk::ListViewText::set_text | ( | guint | row,
|  | guint | column,
|  | const Glib::ustring & | value |
| ) |  |  |

Change an existing value of cell of the list.

Parameters:

  | row | the number of the row in the list.
  | column | the number of the column in the row.
  | value | the new contents of that row and column.

guint Gtk::ListViewText::size | ( |  | ) | const

Returns:
  the number of rows in the listbox

## Member Data Documentation

Glib::RefPtr<Gtk::ListStore> Gtk::ListViewText::m_model `[protected]`

TextModelColumns Gtk::ListViewText::m_model_columns `[protected]`

The documentation for this class was generated from the following file:

- gtkmm/listviewtext.h