index
gtk-- homepage



Description:
Gtk_CList

#include <gtk--/clist.h>
Base classes: Gtk_Container
Derived by: Gtk_CTree

Multi-column list widget designed to handle very much data withoutperformance problems



Properties:


Public member index:


static GtkType get_type();
GtkCList *gtkobj();
const GtkCList *gtkobj()const;
static bool isA(Gtk_Object *checkcast);
virtual ~Gtk_CList();
Gtk_CList(int columns,const gchar *titles[]=0);
Gtk_CList(const Gtk_SArray &titles);
void set_hadjustment(Gtk_Adjustment *adjustment=0);
set adjustments of clist

void set_vadjustment(Gtk_Adjustment *adjustment=0);
void set_hadjustment(Gtk_Adjustment &adjustment);
void set_vadjustment(Gtk_Adjustment &adjustment);
Gtk_Adjustment *get_hadjustment()const;
get adjustments of clist

Gtk_Adjustment *get_vadjustment()const;
void set_shadow_type(GtkShadowType type);
set the border style of the clist, valid choices are:

void set_selection_mode(GtkSelectionMode mode);
set the clist's selection mode

void set_reorderable(bool reorderable);
enable clists reorder ability

void set_use_drag_icons(bool use_icons);
void set_button_actions(guint button,guint8 button_actions);
void freeze();
freeze all visual updates of the list

void thaw();
thaw the list (see freeze)

void column_titles_show();
show the column title buttons

void column_titles_hide();
hide the column title buttons

void column_title_active(gint column);
activate title

void column_title_passive(gint column);
set the column title to be passive where it acts as just a title

void column_titles_active();
set all column titles to be a active

void column_titles_passive();
set all column titles to be passive where they act as just a title

void set_column_title(gint column,const string &title);
set the title in the column title button

string get_column_title(gint column)const;
returns the title of column. Returns an empty string if title is not set

void set_column_widget(gint column,Gtk_Widget &widget);
set a widget instead of a title for the column title button

Gtk_Widget *get_column_widget(gint column)const;
set a widget instead of a title for the column title buttonreturns the column widget

void set_column_justification(gint column,GtkJustification justification);
set the justification on a column

void set_column_visibility(gint column,bool visible);
set visibility of a column

void set_column_resizeable(gint column,bool resizeable);
enable/disable column resize operations by mouse

void set_column_auto_resize(gint column,bool auto_resize);
resize column automatically to its optimal width

gint columns_autosize();
gint optimal_column_width(gint column)const;
return the optimal column width, i.e. maximum of all cell widths

void set_column_width(gint column,gint width);
set the pixel width of a column; this is a necessary step in

void set_column_min_width(gint column,gint min_width);
set column minimum/maximum width. min/max_width < 0 => no restriction

void set_column_max_width(gint column,gint max_width);
void set_row_height(guint height);
change the height of one row

void moveto(gint row,gint column,gfloat row_align=0 . 5,gfloat col_align=0 . 5);
scroll the viewing area of the list

GtkVisibility row_is_visible(gint row)const;
whether the row is visible

GtkCellType get_cell_type(gint row,gint column)const;
returns the cell type which is one of

void set_text(gint row,gint column,const string &text);
sets a given cell's text, replacing it's current contents

bool get_text(gint row,gint column,gtkmm_string *text)const;
get cell's text

bool get_text(gint row,gint column,string &text)const;
gtkmm_string get_text(gint row,gint column)const;
void set_pixmap(gint row,gint column,const Gdk_Pixmap &pixmap,const Gdk_Bitmap &mask);
sets a given cell's pixmap, replacing it's current contents

gint get_pixmap(gint row,gint column,Gdk_Pixmap &pixmap,Gdk_Bitmap &mask)const;
get cell's pixmap

void set_pixtext(gint row,gint column,const string &text,guint8 spacing,const Gdk_Pixmap &pixmap,const Gdk_Bitmap &mask);
sets a given cell's pixmap and text, replacing it's current contents

bool get_pixtext(gint row,gint column,gtkmm_string *text,guint8 *spacing,Gdk_Pixmap &pixmap,Gdk_Bitmap &mask)const;
any of the return pointer can be NULL if you are not interested

void set_foreground(gint row,const Gdk_Color &color);
sets the foreground color of a row, the color must already

void set_background(gint row,const Gdk_Color &color);
sets the background color of a row, the color must already

void set_cell_style(gint row,gint column,Gtk_Style &style);
set / get cell styles

void set_row_style(gint row,Gtk_Style &style);
Gtk_Style *get_row_style(gint row)const;
Gtk_Style *get_cell_style(gint row,gint column)const;
void set_selectable(gint row,bool selectable);
set/get selectable flag of a single row

bool get_selectable(gint row)const;
void set_shift(gint row,gint column,gint vertical,gint horizontal);
this sets a horizontal and vertical for drawing

gint prepend(const Gtk_SArray &text);
prepend/append returns the index of the row you just added, making

gint append(const Gtk_SArray &text);
gint prepend_row(const Gtk_SArray &text);
*_row functions added for symmetry reasons

gint append_row(const Gtk_SArray &text);
gint insert_row(gint row,const Gtk_SArray &text);
inserts a row at index row

void remove_row(gint row);
removes row at index row

iterator for traversing over the rows

iterator for traversing through selected items

iterator begin();
beginning of row_list

iterator end();
end of row_list

seliterator selbegin();
beginning of selection (STL style iterators)

seliterator selend();
end of selection (STL style iterators)

void set_row_data(gint row,gpointer data);
sets a arbitrary data pointer for a given row

gpointer get_row_data(gint row)const;
returns the data set for a row

void set_row_data_full(gint row,gpointer data,GtkDestroyNotify destroy);
sets a data pointer for a given row with destroy notification

gint find_row_from_data(gpointer data)const;
given a data pointer, find the first (and hopefully only!)

void cause_select_row(gint row,gint column);
force selection of a row

void cause_unselect_row(gint row,gint column);
force unselection of a row

void clear();
undo the last select/unselect operationclear the entire list -- this is much faster than removing

gint get_selection_info(gint x,gint y,gint *row,gint *column)const;
return the row column corresponding to the x and y coordinates

void swap_rows(gint row1,gint row2);
in multiple or extended mode, select all rowsin all modes except browse mode, deselect all rowsswap the position of two rows

void set_compare_func(GtkCListCompareFunc cmp_func);
move row from source_row position to dest_row positionsets a compare function different to the default

void set_sort_column(gint column);
the column to sort by

void set_sort_type(GtkSortType sort_type);
how to sort : ascending or descending

void sort();
sort the list with the current compare function

void set_auto_sort(bool auto_sort);
Automatically sort upon insertion

gint get_column_width(gint column)const;
returns the width in pixels of the column, returns -1 if the column

gint rows();
A couple of convenience accessors

gint columns();
signal void select_row(gint,gint,GdkEvent *);
for user emittable functions see cause_select_row(), cause_unselect_row()

signal void unselect_row(gint,gint,GdkEvent *);
emitable signal void row_move(gint,gint);
signal void click_column(gint);
signal void resize_column(gint,gint);
signal void toggle_focus_row();
signal void toggle_add_mode();
emitable signal void select_all();
emitable signal void unselect_all();
emitable signal void undo_selection();
signal void start_selection();
signal void end_selection();
signal void extend_selection(GtkScrollType,gfloat,gboolean);
signal void scroll_vertical(GtkScrollType,gfloat);
signal void scroll_horizontal(GtkScrollType,gfloat);
signal void abort_column_resize();
emitable signal void Gtk_Adjustment *,Gtk_Adjustment *(set_scroll_adjustments);
Protected member index:


void initialize_class();
void *get_parent_class();
static void init_parent_class();
explicit Gtk_CList(GtkCList *castitem);
virtual void select_row_impl(gint p0,gint p1,GdkEvent *p2);
virtual void unselect_row_impl(gint p0,gint p1,GdkEvent *p2);
virtual void row_move_impl(gint p0,gint p1);
virtual void click_column_impl(gint p0);
virtual void resize_column_impl(gint p0,gint p1);
virtual void toggle_focus_row_impl();
virtual void toggle_add_mode_impl();
virtual void select_all_impl();
virtual void unselect_all_impl();
virtual void undo_selection_impl();
virtual void start_selection_impl();
virtual void end_selection_impl();
virtual void extend_selection_impl(GtkScrollType p0,gfloat p1,gboolean p2);
virtual void scroll_vertical_impl(GtkScrollType p0,gfloat p1);
virtual void scroll_horizontal_impl(GtkScrollType p0,gfloat p1);
virtual void abort_column_resize_impl();
virtual void set_scroll_adjustments_impl(Gtk_Adjustment *p0,Gtk_Adjustment *p1);
virtual int insert_row_impl(gint row,gchar **p1);
virtual void remove_row_impl(gint row);
virtual void clear_impl();
virtual void sort_list_impl();
Private member index:


Gtk_CList(const Gtk_CList &);
Gtk_CList &operator =(const Gtk_CList &);
virtual bool check_seliterator_type()const;

Public member details:


set_shadow_type
void Gtk_CList::set_shadow_type(GtkShadowType type);

set the border style of the clist, valid choices are:
GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN, GTK_SHADOW_ETCHED_OUT


set_selection_mode
void Gtk_CList::set_selection_mode(GtkSelectionMode mode);

set the clist's selection mode
GTK_SELECTION_SINGLE, GTK_SELECTION_BROWSE, GTK_SELECTION_MULTIPLE, GTK_SELECTION_EXTENDED


freeze
void Gtk_CList::freeze();

freeze all visual updates of the list
and then thaw the list after you have made a number of changes and the updates will occure in a more efficent manner than if you made them on a unfrozen list


column_title_active
void Gtk_CList::column_title_active(gint column);

activate title
(responds to button presses, prelights, and grabs keyboard focus)


column_titles_active
void Gtk_CList::column_titles_active();

set all column titles to be a active
(respond to button presses, prelight, and grab keyboard focus)


set_column_justification
void Gtk_CList::set_column_justification(gint column,GtkJustification justification);

set the justification on a column
valid choices are: GTK_JUSTIFY_LEFT, GTK_JUSTIFY_RIGHT, GTK_JUSTIFY_CENTER, GTK_JUSTIFY_FILL


set_column_width
void Gtk_CList::set_column_width(gint column,gint width);

set the pixel width of a column; this is a necessary step in
creating a CList because otherwise the column width is chozen from the width of the column title, which will never be right


set_row_height
void Gtk_CList::set_row_height(guint height);

change the height of one row
the default is the hight of the current font


moveto
void Gtk_CList::moveto(gint row,gint column,gfloat row_align=0 . 5,gfloat col_align=0 . 5);

scroll the viewing area of the list
to the given column and row; row_align and col_align are between 0-1 representing the location the row should appear on the screnn, 0.0 being top or left, 1.0 being bottom or right; if row or column is -1 then then there is no change


get_cell_type
GtkCellType Gtk_CList::get_cell_type(gint row,gint column)const;

returns the cell type which is one of
GTK_CELL_EMPTY, GTK_CELL_TEXT, GTK_CELL_PIXMAP, GTK_CELL_PIXTEXT, GTK_CELL_WIDGET


get_text
bool Gtk_CList::get_text(gint row,gint column,gtkmm_string *text)const;

get cell's text
returns true on success


get_pixmap
gint Gtk_CList::get_pixmap(gint row,gint column,Gdk_Pixmap &pixmap,Gdk_Bitmap &mask)const;

get cell's pixmap
returns 1 on success any of the return pointer can be NULL if you are not interested


set_foreground
void Gtk_CList::set_foreground(gint row,const Gdk_Color &color);

sets the foreground color of a row, the color must already
be allocated


set_background
void Gtk_CList::set_background(gint row,const Gdk_Color &color);

sets the background color of a row, the color must already
be allocated


set_shift
void Gtk_CList::set_shift(gint row,gint column,gint vertical,gint horizontal);

this sets a horizontal and vertical for drawing
the contents of a cell; it can be positive or negative; this is particulary useful for indenting items in a column


prepend
gint Gtk_CList::prepend(const Gtk_SArray &text);

prepend/append returns the index of the row you just added, making
it easier to append and modify a row

Example:

 gchar **row = new gchar*[num_of_columns];
 row[0]="cell1";
 row[1]="cell2";
 ...
 row[num_of_columns-1]="cellN-1";
 clist->append(row);
 


insert_row
gint Gtk_CList::insert_row(gint row,const Gtk_SArray &text);

inserts a row at index row
Note: this is gtk_clist_insert() in gtk, but renamed here to insert_row()


remove_row
void Gtk_CList::remove_row(gint row);

removes row at index row
Note: this is gtk_clist_remove() in gtk, but renamed here to remove_row()


find_row_from_data
gint Gtk_CList::find_row_from_data(gpointer data)const;

given a data pointer, find the first (and hopefully only!)
row that points to that data, or -1 if none do


clear
void Gtk_CList::clear();

undo the last select/unselect operationclear the entire list -- this is much faster than removing
is a signal!! each item with remove.


get_selection_info
gint Gtk_CList::get_selection_info(gint x,gint y,gint *row,gint *column)const;

return the row column corresponding to the x and y coordinates

reference and pointer style available


swap_rows
void Gtk_CList::swap_rows(gint row1,gint row2);

in multiple or extended mode, select all rowsin all modes except browse mode, deselect all rowsswap the position of two rows
is a signal!! is a signal!!


set_compare_func
void Gtk_CList::set_compare_func(GtkCListCompareFunc cmp_func);

move row from source_row position to dest_row positionsets a compare function different to the default
is a signal!!


get_column_width
gint Gtk_CList::get_column_width(gint column)const;

returns the width in pixels of the column, returns -1 if the column
doens't exist column is 0 based.


Protected member details:



Private member details:



Examples:





(pages generated by PERCEPS -script.)