RE: gtktreeview, Put icon and text in one column.?
- From: <martyn 2 russell bt com>
- To: <lgs sicem biz>, <tom liu flextrade com>
- Cc: <gtk-app-devel-list gnome org>
- Subject: RE: gtktreeview, Put icon and text in one column.?
- Date: Thu, 12 Feb 2004 16:02:55 -0000
El jue, 12-02-2004 a las 15:24, Tom Liu escribió:
I want to put icons in to gtktreeview, like the folder icon, file icon
etc.
The icon and text should be in one column. Should I make my own
RellRenderer?
Looks like that I should merge the GtkCellRendererPixbuf and
GtkCellRendererText to one Renderer. Is someone already done this?
You can pack several renderers in one column. Se the GtkTreeViewColumn
API for a hint about how to do that.
For example:
GtkTreeViewColumn *column = NULL;
GtkCellRenderer *renderer = NULL;
/* create column */
column = gtk_tree_view_column_new();
/* COL_IMAGE */
renderer = gtk_cell_renderer_pixbuf_new();
gtk_tree_view_column_pack_start(column, renderer, FALSE);
gtk_tree_view_column_set_cell_data_func (column, renderer,
(GtkTreeCellDataFunc)
model_cell_image_func,
window,
NULL);
/* COL_TEXT */
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_column_pack_start(column, renderer, TRUE);
gtk_tree_view_column_set_cell_data_func (column, renderer,
(GtkTreeCellDataFunc) model_cell_text_func,
window,
NULL);
/* insert column */
gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]