gtkmm 2.24.2
Classes | Public Types | Public Member Functions | Protected Attributes

Gtk::ListViewText Class Reference

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

Inheritance diagram for Gtk::ListViewText:
Inheritance graph
[legend]
Collaboration diagram for Gtk::ListViewText:
Collaboration graph
[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.
guint append (const Glib::ustring& column_one_value=Glib::ustring())
 Add a new row at the end of the list.
void prepend (const Glib::ustring& column_one_value=Glib::ustring())
 Insert a new row at the beginning of the list.
void insert (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::ListStorem_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


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 ( const Glib::ustring column_one_value = Glib::ustring())

Add a new row at the end of the list.

Parameters:
column_one_valuethe new text for the new row, column 0
Returns:
the number of the row added
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_valuethe new text for the new row, column 0
Returns:
the number of the row added
Deprecated:
Use append().
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:
columnthe 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:
rowthe number of the row in the listbox.
columnthe number of the column in the row.
Returns:
the value of that cell, if it exists.
void Gtk::ListViewText::insert ( guint  row,
const Glib::ustring column_one_value = Glib::ustring() 
)

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

Parameters:
rowThe row number
column_one_valuethe new text for the new row, column 0
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:
rowThe row number
column_one_valuethe new text for the new row, column 0
Deprecated:
Use insert().
void Gtk::ListViewText::prepend ( const Glib::ustring column_one_value = Glib::ustring())

Insert a new row at the beginning of the list.

Parameters:
column_one_valuethe 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_valuethe new text for the new row, column 0
Deprecated:
Use prepend().
void Gtk::ListViewText::set_column_title ( guint  column,
const Glib::ustring title 
)

Adds a title to column column.

Parameters:
columnthe column number.
titlethe 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:
rowthe number of the row in the list.
valuethe 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:
rowthe number of the row in the list.
columnthe number of the column in the row.
valuethe new contents of that row and column.
guint Gtk::ListViewText::size ( ) const
Returns:
the number of rows in the listbox

Member Data Documentation


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