本文整理汇总了C++中GTK_CELL_RENDERER函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_CELL_RENDERER函数的具体用法?C++ GTK_CELL_RENDERER怎么用?C++ GTK_CELL_RENDERER使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_CELL_RENDERER函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: custom_cell_renderer_progress_init
static void
custom_cell_renderer_progress_init (CustomCellRendererProgress *cellrendererprogress)
{
GTK_CELL_RENDERER(cellrendererprogress)->mode = GTK_CELL_RENDERER_MODE_INERT;
GTK_CELL_RENDERER(cellrendererprogress)->xpad = 2;
GTK_CELL_RENDERER(cellrendererprogress)->ypad = 2;
}
开发者ID:Bibamaru,项目名称:showtime,代码行数:7,代码来源:gu_cell_bar.c
示例2: x_fstylecb_new
/*! \brief Create a ComboBox with the gschem fill styles.
*
* \return GtkWidget
*/
GtkWidget*
x_fstylecb_new ()
{
GtkComboBox *combo;
GtkCellLayout *layout;
GtkCellRenderer *swatch_cell;
GtkCellRenderer *text_cell;
if (fstyle_list_store == NULL) {
fstyle_list_store = create_fstyle_list_store ();
}
combo = GTK_COMBO_BOX (gtk_combo_box_new_with_model (GTK_TREE_MODEL (fstyle_list_store)));
layout = GTK_CELL_LAYOUT (combo); /* For convenience */
/* Renders the fill swatch. Since this won't contain text, set a
* minimum width. */
swatch_cell = GTK_CELL_RENDERER (gschem_fill_swatch_cell_renderer_new ());
g_object_set (swatch_cell, "width", 25, NULL);
gtk_cell_layout_pack_start (layout, swatch_cell, FALSE);
gtk_cell_layout_add_attribute (layout, swatch_cell, "fill-type", COLUMN_INDEX);
/* Renders the name of the fill style */
text_cell = GTK_CELL_RENDERER (gtk_cell_renderer_text_new());
g_object_set (text_cell, "xpad", 5, NULL);
gtk_cell_layout_pack_start (layout, text_cell, TRUE);
gtk_cell_layout_add_attribute (layout, text_cell, "text", COLUMN_NAME);
return GTK_WIDGET (combo);
}
开发者ID:blueantst,项目名称:geda-gaf,代码行数:34,代码来源:x_fstylecb.c
示例3: book_tree_add_columns
static void
book_tree_add_columns (DhBookTree *tree)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
column = gtk_tree_view_column_new ();
renderer = GTK_CELL_RENDERER (gtk_cell_renderer_pixbuf_new ());
gtk_tree_view_column_pack_start (column, renderer, FALSE);
gtk_tree_view_column_set_attributes
(column, renderer,
"pixbuf", COL_OPEN_PIXBUF,
"pixbuf-expander-open", COL_OPEN_PIXBUF,
"pixbuf-expander-closed", COL_CLOSED_PIXBUF,
NULL);
renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"text", COL_TITLE,
NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (tree), column);
}
开发者ID:EQ4,项目名称:samplecat,代码行数:25,代码来源:dh_tree.c
示例4: gqv_cell_renderer_icon_init
static void
gqv_cell_renderer_icon_init(GQvCellRendererIcon *cellicon)
{
GTK_CELL_RENDERER(cellicon)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
GTK_CELL_RENDERER(cellicon)->xpad = 2;
GTK_CELL_RENDERER(cellicon)->ypad = 2;
}
开发者ID:GroupO,项目名称:geeqie_zas,代码行数:7,代码来源:cellrenderericon.c
示例5: thunar_icon_renderer_init
static void
thunar_icon_renderer_init (ThunarIconRenderer *icon_renderer)
{
/* use 1px padding */
GTK_CELL_RENDERER (icon_renderer)->xpad = 1;
GTK_CELL_RENDERER (icon_renderer)->ypad = 1;
}
开发者ID:fibernet-us,项目名称:Thunar_sort_files_by_extension,代码行数:7,代码来源:thunar-icon-renderer.c
示例6: custom_cell_renderer_button_init
/***************************************************************************
*
* custom_cell_renderer_button_init: set some default properties of the
* parent (GtkCellRendererPixbuf).
*
***************************************************************************/
static void
custom_cell_renderer_button_init (CustomCellRendererButton *cellbutton)
{
GTK_CELL_RENDERER(cellbutton)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
GTK_CELL_RENDERER(cellbutton)->xpad = 2;
GTK_CELL_RENDERER(cellbutton)->ypad = 2;
}
开发者ID:273657127,项目名称:HandBrake,代码行数:13,代码来源:renderer_button.c
示例7: git_stash_pane_init
static void
git_stash_pane_init (GitStashPane *self)
{
gchar *objects[] = {"stash_pane",
"stash_model",
NULL};
GError *error = NULL;
GtkTreeView *stash_view;
GtkTreeViewColumn *stash_number_column;
GtkCellRenderer *stash_number_renderer;
GtkTreeViewColumn *stash_message_column;
GtkCellRenderer *stash_message_renderer;
GtkCellRenderer *diff_renderer;
GtkTreeSelection *selection;
self->priv = g_new0 (GitStashPanePriv, 1);
self->priv->builder = gtk_builder_new ();
if (!gtk_builder_add_objects_from_file (self->priv->builder, BUILDER_FILE,
objects,
&error))
{
g_warning ("Couldn't load builder file: %s", error->message);
g_error_free (error);
}
stash_view = GTK_TREE_VIEW (gtk_builder_get_object (self->priv->builder,
"stash_view"));
stash_number_column = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (self->priv->builder,
"stash_number_column"));
stash_number_renderer = GTK_CELL_RENDERER (gtk_builder_get_object (self->priv->builder,
"stash_number_renderer"));
stash_message_column = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (self->priv->builder,
"stash_message_column"));
stash_message_renderer = GTK_CELL_RENDERER (gtk_builder_get_object (self->priv->builder,
"stash_message_renderer"));
diff_renderer = anjuta_cell_renderer_diff_new ();
selection = gtk_tree_view_get_selection (stash_view);
gtk_tree_view_column_set_cell_data_func (stash_number_column, stash_number_renderer,
stash_number_renderer_data_func,
NULL, NULL);
gtk_tree_view_column_set_cell_data_func (stash_message_column, stash_message_renderer,
stash_message_renderer_data_func,
NULL, NULL);
gtk_tree_view_column_pack_start (stash_message_column, diff_renderer, TRUE);
gtk_tree_view_column_add_attribute (stash_message_column, diff_renderer,
"diff", COL_DIFF);
/* Don't allow diffs to be selected */
gtk_tree_selection_set_select_function (selection, on_stash_view_row_selected,
NULL, NULL);
g_signal_connect (G_OBJECT (stash_view), "button-press-event",
G_CALLBACK (on_stash_view_button_press_event),
self);
}
开发者ID:VujinovM,项目名称:anjuta,代码行数:58,代码来源:git-stash-pane.c
示例8: gtk_cell_renderer_text_init
static void
gtk_cell_renderer_text_init (GtkCellRendererText *celltext)
{
GTK_CELL_RENDERER (celltext)->xalign = 0.0;
GTK_CELL_RENDERER (celltext)->yalign = 0.5;
GTK_CELL_RENDERER (celltext)->xpad = 2;
GTK_CELL_RENDERER (celltext)->ypad = 2;
celltext->fixed_height_rows = -1;
celltext->font = pango_font_description_new ();
}
开发者ID:zjx632,项目名称:tinygtk,代码行数:10,代码来源:gtkcellrenderertext.c
示例9: freetuxtv_cellrenderer_channelslist_init
static void
freetuxtv_cellrenderer_channelslist_init (FreetuxTVCellRendererChannelsList *self)
{
#if GTK_API_VERSION == 3
gtk_cell_renderer_set_padding (GTK_CELL_RENDERER(self), 2, 2);
#else
GTK_CELL_RENDERER(self)->mode = GTK_CELL_RENDERER_MODE_INERT;
GTK_CELL_RENDERER(self)->xpad = 2;
GTK_CELL_RENDERER(self)->ypad = 2;
#endif
}
开发者ID:Glubschauge,项目名称:freetuxtv,代码行数:11,代码来源:freetuxtv-cellrenderer-channelslist.c
示例10: uploads_get_dialog
/**
* uploads_get_dialog:
*
* Returns the a #GtkWindow representing the Uploads window. If it
* has not already been created, it creates it. The Uploads window is
* set to be hidden instead of destroyed when closed, to avoid having
* to recreate it and re-parse the UI file, etc.
**/
static GtkWindow *
uploads_get_dialog (XviewerPostasaPlugin *plugin)
{
GtkBuilder *builder;
GError *error = NULL;
GtkButton *cancel_button;
GtkButton *cancel_all_button;
if (plugin->priv->uploads_window == NULL) {
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
gtk_builder_add_from_resource (builder, GTKBUILDER_UPLOAD_FILE,
&error);
if (error != NULL) {
g_warning ("Couldn't load Postasa uploads UI file:%d:%s", error->code, error->message);
g_error_free (error);
return NULL;
}
/* note: do not unref gtk_builder_get_object() returns */
plugin->priv->uploads_window = GTK_WINDOW (gtk_builder_get_object (builder, "uploads_window"));
plugin->priv->uploads_view = GTK_TREE_VIEW (gtk_builder_get_object (builder, "uploads_view"));
plugin->priv->uploads_store = GTK_LIST_STORE (gtk_builder_get_object (builder, "uploads_store"));
cancel_button = GTK_BUTTON (gtk_builder_get_object (builder, "cancel_button"));
cancel_all_button = GTK_BUTTON (gtk_builder_get_object (builder, "cancel_all_button"));
/* TODO: can't set expand = TRUE when packing cells into columns via glade-3/GtkBuilder apparently?
bgo #602152 So for now, we take them, clear them out, and remap them. Ugh. Better solutions welcome. */
GtkTreeViewColumn *file_col = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (builder, "file_col"));
GtkCellRenderer *thumbnail_cell = GTK_CELL_RENDERER (gtk_builder_get_object (builder, "thumbnail_cell"));
GtkCellRenderer *filepath_cell = GTK_CELL_RENDERER (gtk_builder_get_object (builder, "filepath_cell"));
gtk_tree_view_column_clear (file_col);
gtk_tree_view_column_pack_start (file_col, thumbnail_cell, FALSE);
gtk_tree_view_column_pack_end (file_col, filepath_cell, TRUE);
gtk_tree_view_column_add_attribute (file_col, thumbnail_cell, "pixbuf", 0);
gtk_tree_view_column_add_attribute (file_col, filepath_cell, "text", 1);
GtkTreeViewColumn *progress_col = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (builder, "progress_col"));
GtkCellRenderer *progress_cell = GTK_CELL_RENDERER (gtk_builder_get_object (builder, "progress_cell"));
gtk_tree_view_column_clear (progress_col);
gtk_tree_view_column_pack_end (progress_col, progress_cell, TRUE);
gtk_tree_view_column_add_attribute (progress_col, progress_cell, "pulse", 3);
gtk_tree_view_column_add_attribute (progress_col, progress_cell, "text", 5);
g_object_unref (builder);
g_signal_connect (G_OBJECT (cancel_button), "clicked", G_CALLBACK (uploads_cancel_cb), plugin);
g_signal_connect (G_OBJECT (cancel_all_button), "clicked", G_CALLBACK (uploads_cancel_all_cb), plugin);
g_signal_connect (G_OBJECT (plugin->priv->uploads_window), "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), plugin);
}
return plugin->priv->uploads_window;
}
开发者ID:linuxmint,项目名称:xviewer-plugins,代码行数:61,代码来源:xviewer-postasa-plugin.c
示例11: empathy_cell_renderer_expander_init
static void
empathy_cell_renderer_expander_init (EmpathyCellRendererExpander *expander)
{
EmpathyCellRendererExpanderPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (expander,
EMPATHY_TYPE_CELL_RENDERER_EXPANDER, EmpathyCellRendererExpanderPriv);
expander->priv = priv;
priv->expander_style = GTK_EXPANDER_COLLAPSED;
priv->expander_size = 12;
priv->activatable = TRUE;
priv->animation_node = NULL;
GTK_CELL_RENDERER (expander)->xpad = 2;
GTK_CELL_RENDERER (expander)->ypad = 2;
GTK_CELL_RENDERER (expander)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
}
开发者ID:Elleo,项目名称:empathy,代码行数:16,代码来源:empathy-cell-renderer-expander.c
示例12: gtk_cell_renderer_text_new
static GtkTreeViewColumn *divelist_column(struct DiveList *dl, int index, const char *title,
data_func_t data_func, PangoAlignment align)
{
GtkCellRenderer *renderer;
GtkTreeViewColumn *col;
double xalign = 0.0; /* left as default */
renderer = gtk_cell_renderer_text_new();
col = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(col, title);
gtk_tree_view_column_set_sort_column_id(col, index);
gtk_tree_view_column_set_resizable(col, TRUE);
gtk_tree_view_column_pack_start(col, renderer, TRUE);
if (data_func)
gtk_tree_view_column_set_cell_data_func(col, renderer, data_func, NULL, NULL);
else
gtk_tree_view_column_add_attribute(col, renderer, "text", index);
gtk_object_set(GTK_OBJECT(renderer), "alignment", align, NULL);
switch (align) {
case PANGO_ALIGN_LEFT:
xalign = 0.0;
break;
case PANGO_ALIGN_CENTER:
xalign = 0.5;
break;
case PANGO_ALIGN_RIGHT:
xalign = 1.0;
break;
}
gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), xalign, 0.5);
gtk_tree_view_append_column(GTK_TREE_VIEW(dl->tree_view), col);
return col;
}
开发者ID:draco003,项目名称:subsurface,代码行数:34,代码来源:divelist.c
示例13: set_pixbuf
static void
set_pixbuf (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
GtkTreeModel *model,
GtkTreeIter *iter,
gpointer user_data)
{
GdkPixbuf *pixbuf = NULL;
CongServiceDocumentFactory *factory;
gtk_tree_model_get (model, iter,
NEWDOCTYPELIST_FACTORY_COLUMN, &factory,
-1);
if (NULL==factory) {
return;
}
pixbuf = cong_document_factory_get_icon(factory);
g_object_set (GTK_CELL_RENDERER (cell), "pixbuf", pixbuf, NULL);
if (pixbuf) {
g_object_unref (pixbuf);
}
}
开发者ID:GNOME,项目名称:conglomerate,代码行数:25,代码来源:cong-file-new.c
示例14: gossip_cell_renderer_expander_init
static void
gossip_cell_renderer_expander_init (GossipCellRendererExpander *expander)
{
GossipCellRendererExpanderPriv *priv;
priv = GET_PRIV (expander);
priv->expander_style = GTK_EXPANDER_COLLAPSED;
priv->expander_size = 12;
priv->activatable = TRUE;
priv->animation_node = NULL;
GTK_CELL_RENDERER (expander)->xpad = 2;
GTK_CELL_RENDERER (expander)->ypad = 2;
GTK_CELL_RENDERER (expander)->mode = GTK_CELL_RENDERER_MODE_ACTIVATABLE;
}
开发者ID:davewongillies,项目名称:gmameui,代码行数:16,代码来源:gossip-cell-renderer-expander.c
示例15: attachment_button_update_pixbufs
static void
attachment_button_update_pixbufs (EAttachmentButton *button)
{
GtkCellLayout *cell_layout;
GtkCellRenderer *renderer;
GdkPixbuf *pixbuf_expander_open;
GdkPixbuf *pixbuf_expander_closed;
GList *list;
/* Grab the first cell renderer. */
cell_layout = GTK_CELL_LAYOUT (button->priv->cell_view);
list = gtk_cell_layout_get_cells (cell_layout);
renderer = GTK_CELL_RENDERER (list->data);
g_list_free (list);
pixbuf_expander_open = gtk_widget_render_icon (
GTK_WIDGET (button), GTK_STOCK_GO_DOWN,
GTK_ICON_SIZE_BUTTON, NULL);
pixbuf_expander_closed = gtk_widget_render_icon (
GTK_WIDGET (button), GTK_STOCK_GO_FORWARD,
GTK_ICON_SIZE_BUTTON, NULL);
g_object_set (
renderer,
"pixbuf-expander-open", pixbuf_expander_open,
"pixbuf-expander-closed", pixbuf_expander_closed,
NULL);
g_object_unref (pixbuf_expander_open);
g_object_unref (pixbuf_expander_closed);
}
开发者ID:jdapena,项目名称:evolution,代码行数:32,代码来源:e-attachment-button.c
示例16: plugin_disable_set_func
static void plugin_disable_set_func(GtkTreeViewColumn *tree_column, GtkCellRenderer *cell,
GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data)
{
gboolean disabled;
gtk_tree_model_get(tree_model, iter, DESKTOP_FILE_COLUMN_DISABLED, &disabled, -1);
if (disabled)
{
g_object_set(GTK_CELL_RENDERER(cell), "active", TRUE, NULL);
}
else
{
g_object_set(GTK_CELL_RENDERER(cell), "active", FALSE, NULL);
}
}
开发者ID:BestImageViewer,项目名称:geeqie,代码行数:16,代码来源:desktop_file.c
示例17: attachment_button_update_pixbufs
static void
attachment_button_update_pixbufs (EAttachmentButton *button)
{
GtkIconTheme *icon_theme;
GtkCellLayout *cell_layout;
GtkCellRenderer *renderer;
GdkPixbuf *pixbuf_expander_open;
GdkPixbuf *pixbuf_expander_closed;
GList *list;
icon_theme = gtk_icon_theme_get_default ();
/* Grab the first cell renderer. */
cell_layout = GTK_CELL_LAYOUT (button->priv->cell_view);
list = gtk_cell_layout_get_cells (cell_layout);
renderer = GTK_CELL_RENDERER (list->data);
g_list_free (list);
pixbuf_expander_open = gtk_icon_theme_load_icon (
icon_theme, "go-down",
GTK_ICON_SIZE_BUTTON, 0, NULL);
pixbuf_expander_closed = gtk_icon_theme_load_icon (
icon_theme, "go-next",
GTK_ICON_SIZE_BUTTON, 0, NULL);
g_object_set (
renderer,
"pixbuf-expander-open", pixbuf_expander_open,
"pixbuf-expander-closed", pixbuf_expander_closed,
NULL);
g_object_unref (pixbuf_expander_open);
g_object_unref (pixbuf_expander_closed);
}
开发者ID:Distrotech,项目名称:evolution,代码行数:35,代码来源:e-attachment-button.c
示例18: GTK_CELL_RENDERER
GtkCellRenderer *trg_cell_renderer_numgteqthan_new(gint64 minvalue)
{
return
GTK_CELL_RENDERER(g_object_new
(TRG_TYPE_CELL_RENDERER_NUMGTEQTHAN, "minvalue",
minvalue, NULL));
}
开发者ID:EnigmaCurry,项目名称:transmission-remote-gtk,代码行数:7,代码来源:trg-cell-renderer-numgteqthan.c
示例19: marlin_text_renderer_editing_done
static void
marlin_text_renderer_editing_done (GtkCellEditable *editable,
MarlinTextRenderer *text_renderer)
{
const gchar *path;
const gchar *text;
gboolean canceled;
//renametest
//printf ("%s\n", G_STRFUNC);
/* disconnect our signals from the cell editable */
g_signal_handlers_disconnect_by_func (G_OBJECT (editable), marlin_text_renderer_focus_out_event, text_renderer);
g_signal_handlers_disconnect_by_func (G_OBJECT (editable), marlin_text_renderer_editing_done, text_renderer);
g_signal_handlers_disconnect_by_func (G_OBJECT (editable), marlin_text_renderer_populate_popup, text_renderer);
g_object_get (editable, "editing-canceled", &canceled, NULL);
/* let the GtkCellRenderer class do it's part of the job */
gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (text_renderer), canceled);
/* inform whoever is interested that we have new text (if not cancelled) */
if (G_LIKELY (!canceled))
{
//text = gtk_entry_get_text (GTK_ENTRY (editable));
text = eel_editable_label_get_text (EEL_EDITABLE_LABEL (editable));
path = g_object_get_data (G_OBJECT (editable), "marlin-text-renderer-path");
g_signal_emit (G_OBJECT (text_renderer), text_renderer_signals[EDITED], 0, path, text);
}
}
开发者ID:ammonkey,项目名称:marlin,代码行数:29,代码来源:marlin-text-renderer.c
示例20: gail_text_cell_get_character_extents
static void
gail_text_cell_get_character_extents (AtkText *text,
gint offset,
gint *x,
gint *y,
gint *width,
gint *height,
AtkCoordType coords)
{
GailRendererCell *gail_renderer;
GtkCellRendererText *gtk_renderer;
GdkRectangle rendered_rect;
GtkWidget *widget;
AtkObject *parent;
PangoRectangle char_rect;
PangoLayout *layout;
gint x_offset, y_offset, index, cell_height, cell_width;
if (!GAIL_TEXT_CELL (text)->cell_text)
{
*x = *y = *height = *width = 0;
return;
}
if (offset < 0 || offset >= GAIL_TEXT_CELL (text)->cell_length)
{
*x = *y = *height = *width = 0;
return;
}
gail_renderer = GAIL_RENDERER_CELL (text);
gtk_renderer = GTK_CELL_RENDERER_TEXT (gail_renderer->renderer);
/*
* Thus would be inconsistent with the cache
*/
gail_return_if_fail (gtk_renderer->text);
parent = atk_object_get_parent (ATK_OBJECT (text));
if (GAIL_IS_CONTAINER_CELL (parent))
parent = atk_object_get_parent (parent);
widget = GTK_ACCESSIBLE (parent)->widget;
g_return_if_fail (GAIL_IS_CELL_PARENT (parent));
gail_cell_parent_get_cell_area (GAIL_CELL_PARENT (parent), GAIL_CELL (text),
&rendered_rect);
gtk_cell_renderer_get_size (GTK_CELL_RENDERER (gtk_renderer), widget,
&rendered_rect, &x_offset, &y_offset, &cell_width, &cell_height);
layout = create_pango_layout (gtk_renderer, widget);
index = g_utf8_offset_to_pointer (gtk_renderer->text,
offset) - gtk_renderer->text;
pango_layout_index_to_pos (layout, index, &char_rect);
gail_misc_get_extents_from_pango_rectangle (widget,
&char_rect,
x_offset + rendered_rect.x + gail_renderer->renderer->xpad,
y_offset + rendered_rect.y + gail_renderer->renderer->ypad,
x, y, width, height, coords);
g_object_unref (layout);
return;
}
开发者ID:coapp-packages,项目名称:gtk,代码行数:59,代码来源:gailtextcell.c
注:本文中的GTK_CELL_RENDERER函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论