Top | ![]() |
![]() |
![]() |
![]() |
A GtkCellView displays a single row of a GtkTreeModel using a GtkCellArea and GtkCellAreaContext. A GtkCellAreaContext can be provided to the GtkCellView at construction time in order to keep the cellview in context of a group of cell views, this ensures that the renderers displayed will be properly aligned with eachother (like the aligned cells in the menus of GtkComboBox).
GtkCellView is GtkOrientable in order to decide in which orientation the underlying GtkCellAreaContext should be allocated. Taking the GtkComboBox menu as an example, cellviews should be oriented horizontally if the menus are listed top-to-bottom and thus all share the same width but may have separate individual heights (left-to-right menus should be allocated vertically since they all share the same height but may have variable widths).
GtkWidget *
gtk_cell_view_new (void
);
Creates a new GtkCellView widget.
Since: 2.6
GtkWidget * gtk_cell_view_new_with_context (GtkCellArea *area
,GtkCellAreaContext *context
);
Creates a new GtkCellView widget with a specific GtkCellArea to layout cells and a specific GtkCellAreaContext.
Specifying the same context for a handfull of cells lets the underlying area synchronize the geometry for those cells, in this way alignments with cellviews for other rows are possible.
area |
the GtkCellArea to layout cells |
|
context |
the GtkCellAreaContext in which to calculate cell geometry |
Since: 2.6
GtkWidget *
gtk_cell_view_new_with_text (const gchar *text
);
Creates a new GtkCellView widget, adds a GtkCellRendererText
to it, and makes it show text
.
Since: 2.6
GtkWidget *
gtk_cell_view_new_with_markup (const gchar *markup
);
Creates a new GtkCellView widget, adds a GtkCellRendererText
to it, and makes it show markup
. The text can be
marked up with the Pango text markup language.
Since: 2.6
GtkWidget *
gtk_cell_view_new_with_pixbuf (GdkPixbuf *pixbuf
);
Creates a new GtkCellView widget, adds a GtkCellRendererPixbuf
to it, and makes it show pixbuf
.
Since: 2.6
void gtk_cell_view_set_model (GtkCellView *cell_view
,GtkTreeModel *model
);
Sets the model for cell_view
. If cell_view
already has a model
set, it will remove it before setting the new model. If model
is
NULL
, then it will unset the old model.
Since: 2.6
GtkTreeModel *
gtk_cell_view_get_model (GtkCellView *cell_view
);
Returns the model for cell_view
. If no model is used NULL
is
returned.
Since: 2.16
void gtk_cell_view_set_displayed_row (GtkCellView *cell_view
,GtkTreePath *path
);
Sets the row of the model that is currently displayed by the GtkCellView. If the path is unset, then the contents of the cellview “stick” at their last value; this is not normally a desired result, but may be a needed intermediate state if say, the model for the GtkCellView becomes temporarily empty.
Since: 2.6
GtkTreePath *
gtk_cell_view_get_displayed_row (GtkCellView *cell_view
);
Returns a GtkTreePath referring to the currently
displayed row. If no row is currently displayed,
NULL
is returned.
Since: 2.6
void gtk_cell_view_set_draw_sensitive (GtkCellView *cell_view
,gboolean draw_sensitive
);
Sets whether cell_view
should draw all of its
cells in a sensitive state, this is used by GtkComboBox menus
to ensure that rows with insensitive cells that contain
children appear sensitive in the parent menu item.
Since: 3.0
gboolean
gtk_cell_view_get_draw_sensitive (GtkCellView *cell_view
);
Gets whether cell_view
is configured to draw all of its
cells in a sensitive state.
Since: 3.0
void gtk_cell_view_set_fit_model (GtkCellView *cell_view
,gboolean fit_model
);
Sets whether cell_view
should request space to fit the entire GtkTreeModel.
This is used by GtkComboBox to ensure that the cell view displayed on the combo box’s button always gets enough space and does not resize when selection changes.
Since: 3.0
gboolean
gtk_cell_view_get_fit_model (GtkCellView *cell_view
);
Gets whether cell_view
is configured to request space
to fit the entire GtkTreeModel.
Since: 3.0