当前位置: 首页>>代码示例>>C++>>正文


C++ GTK_CELL_VIEW函数代码示例

本文整理汇总了C++中GTK_CELL_VIEW函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_CELL_VIEW函数的具体用法?C++ GTK_CELL_VIEW怎么用?C++ GTK_CELL_VIEW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GTK_CELL_VIEW函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: hybrid_chat_window_set_icon

void
hybrid_chat_window_set_icon(HybridChatWindow *window, GdkPixbuf *pixbuf)
{
    GtkTreeModel *model;
    GtkListStore *store;

    g_return_if_fail(window != NULL);

    if (!IS_USER_DEFINED_CHAT(window)) {
        return;
    }

    g_object_ref(pixbuf);
    window->icon = pixbuf;

    model = gtk_cell_view_get_model(GTK_CELL_VIEW(window->tablabel));
    store = GTK_LIST_STORE(model);

    gtk_list_store_set(store, &window->tabiter,
            TAB_STATUS_ICON_COLUMN, pixbuf,
            -1);

    model = gtk_cell_view_get_model(GTK_CELL_VIEW(window->tiplabel));
    store = GTK_LIST_STORE(model);

    gtk_list_store_set(store, &window->tipiter,
            BUDDY_ICON_COLUMN, pixbuf, -1);
}
开发者ID:celiachen,项目名称:hybrid,代码行数:28,代码来源:conv.c

示例2: gtk_cell_view_cell_layout_reorder

static void
gtk_cell_view_cell_layout_reorder (GtkCellLayout   *layout,
                                   GtkCellRenderer *cell,
                                   gint             position)
{
  GList *link;
  GtkCellViewCellInfo *info;
  GtkCellView *cellview = GTK_CELL_VIEW (layout);

  g_return_if_fail (GTK_IS_CELL_VIEW (cellview));
  g_return_if_fail (GTK_IS_CELL_RENDERER (cell));

  info = gtk_cell_view_get_cell_info (cellview, cell);

  g_return_if_fail (info != NULL);
  g_return_if_fail (position >= 0);

  link = g_list_find (cellview->priv->cell_list, info);

  g_return_if_fail (link != NULL);

  cellview->priv->cell_list = g_list_remove_link (cellview->priv->cell_list,
                                                  link);
  cellview->priv->cell_list = g_list_insert (cellview->priv->cell_list,
                                             info, position);

  gtk_widget_queue_draw (GTK_WIDGET (cellview));
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:28,代码来源:gtkcellview.c

示例3: gtk_cell_view_cell_layout_clear_attributes

static void
gtk_cell_view_cell_layout_clear_attributes (GtkCellLayout   *layout,
                                            GtkCellRenderer *renderer)
{
  GtkCellViewCellInfo *info;
  GtkCellView *cellview = GTK_CELL_VIEW (layout);
  GSList *list;

  g_return_if_fail (GTK_IS_CELL_VIEW (cellview));
  g_return_if_fail (GTK_IS_CELL_RENDERER (renderer));

  info = gtk_cell_view_get_cell_info (cellview, renderer);
  if (info != NULL)
    {
      list = info->attributes;
      while (list && list->next)
	{
	  g_free (list->data);
	  list = list->next->next;
	}
      
      g_slist_free (info->attributes);
      info->attributes = NULL;
    }
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:25,代码来源:gtkcellview.c

示例4: gtk_cell_view_cell_layout_set_cell_data_func

static void
gtk_cell_view_cell_layout_set_cell_data_func (GtkCellLayout         *layout,
                                              GtkCellRenderer       *cell,
                                              GtkCellLayoutDataFunc  func,
                                              gpointer               func_data,
                                              GDestroyNotify         destroy)
{
  GtkCellView *cellview = GTK_CELL_VIEW (layout);
  GtkCellViewCellInfo *info;

  g_return_if_fail (GTK_IS_CELL_VIEW (cellview));

  info = gtk_cell_view_get_cell_info (cellview, cell);
  g_return_if_fail (info != NULL);

  if (info->destroy)
    {
      GDestroyNotify d = info->destroy;

      info->destroy = NULL;
      d (info->func_data);
    }

  info->func = func;
  info->func_data = func_data;
  info->destroy = destroy;
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:27,代码来源:gtkcellview.c

示例5: gtk_cell_view_constructor

static GObject *
gtk_cell_view_constructor (GType                  type,
			   guint                  n_construct_properties,
			   GObjectConstructParam *construct_properties)
{
  GObject            *object;
  GtkCellView        *view;
  GtkCellViewPrivate *priv;

  object = G_OBJECT_CLASS (gtk_cell_view_parent_class)->constructor
    (type, n_construct_properties, construct_properties);

  view = GTK_CELL_VIEW (object);
  priv = view->priv;

  if (!priv->area)
    {
      priv->area = gtk_cell_area_box_new ();
      g_object_ref_sink (priv->area);
    }

  if (!priv->context)
    priv->context = gtk_cell_area_create_context (priv->area);

  priv->size_changed_id =
    g_signal_connect (priv->context, "notify",
		      G_CALLBACK (context_size_changed_cb), view);

  return object;
}
开发者ID:BYC,项目名称:gtk,代码行数:30,代码来源:gtkcellview.c

示例6: gtk_cell_view_size_allocate

static void
gtk_cell_view_size_allocate (GtkWidget     *widget,
                             GtkAllocation *allocation)
{
  GtkCellView        *cellview = GTK_CELL_VIEW (widget);
  GtkCellViewPrivate *priv = cellview->priv;
  gint                alloc_width, alloc_height;

  gtk_widget_set_allocation (widget, allocation);

  gtk_cell_area_context_get_allocation (priv->context, &alloc_width, &alloc_height);

  /* The first cell view in context is responsible for allocating the context at allocate time 
   * (or the cellview has its own context and is not grouped with any other cell views) 
   *
   * If the cellview is in "fit model" mode, we assume its not in context and needs to
   * allocate every time.
   */
  if (priv->fit_model)
    gtk_cell_area_context_allocate (priv->context, allocation->width, allocation->height);
  else if (alloc_width != allocation->width && priv->orientation == GTK_ORIENTATION_HORIZONTAL)
    gtk_cell_area_context_allocate (priv->context, allocation->width, -1);
  else if (alloc_height != allocation->height && priv->orientation == GTK_ORIENTATION_VERTICAL)
    gtk_cell_area_context_allocate (priv->context, -1, allocation->height);
}
开发者ID:BYC,项目名称:gtk,代码行数:25,代码来源:gtkcellview.c

示例7: gtk_cell_view_get_preferred_height

static void       
gtk_cell_view_get_preferred_height (GtkWidget *widget,
                                    gint      *minimum_size,
                                    gint      *natural_size)
{
  GtkCellView        *cellview = GTK_CELL_VIEW (widget);
  GtkCellViewPrivate *priv = cellview->priv;

  g_signal_handler_block (priv->context, priv->size_changed_id);

  if (priv->fit_model)
    {
      gint min = 0, nat = 0;
      gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_VERTICAL, -1, &min, &nat);
    }
  else
    {
      if (cellview->priv->displayed_row)
	gtk_cell_view_set_cell_data (cellview);
      
      gtk_cell_area_get_preferred_height (priv->area, priv->context, widget, NULL, NULL);
    }

  gtk_cell_area_context_get_preferred_height (priv->context, minimum_size, natural_size);

  g_signal_handler_unblock (priv->context, priv->size_changed_id);
}
开发者ID:BYC,项目名称:gtk,代码行数:27,代码来源:gtkcellview.c

示例8: gtk_cell_view_get_preferred_height_for_width

static void       
gtk_cell_view_get_preferred_height_for_width (GtkWidget *widget,
                                              gint       for_size,
                                              gint      *minimum_size,
                                              gint      *natural_size)
{
  GtkCellView        *cellview = GTK_CELL_VIEW (widget);
  GtkCellViewPrivate *priv = cellview->priv;

  if (priv->fit_model)
    {
      gint min = 0, nat = 0;
      gtk_cell_view_request_model (cellview, NULL, GTK_ORIENTATION_VERTICAL, for_size, &min, &nat);

      *minimum_size = min;
      *natural_size = nat;
    }
  else
    {
      if (cellview->priv->displayed_row)
	gtk_cell_view_set_cell_data (cellview);

      gtk_cell_area_get_preferred_height_for_width (priv->area, priv->context, widget, 
						    for_size, minimum_size, natural_size);
    }
}
开发者ID:BYC,项目名称:gtk,代码行数:26,代码来源:gtkcellview.c

示例9: gtk_cell_view_set_property

static void
gtk_cell_view_set_property (GObject      *object,
                            guint         param_id,
                            const GValue *value,
                            GParamSpec   *pspec)
{
  GtkCellView *view = GTK_CELL_VIEW (object);

  switch (param_id)
    {
      case PROP_BACKGROUND:
        {
          GdkColor color;

          if (!g_value_get_string (value))
            gtk_cell_view_set_background_color (view, NULL);
          else if (gdk_color_parse (g_value_get_string (value), &color))
            gtk_cell_view_set_background_color (view, &color);
          else
            g_warning ("Don't know color `%s'", g_value_get_string (value));

          g_object_notify (object, "background_gdk");
        }
        break;
      case PROP_BACKGROUND_GDK:
        gtk_cell_view_set_background_color (view, g_value_get_boxed (value));
        break;
      case PROP_BACKGROUND_SET:
        view->priv->background_set = g_value_get_boolean (value);
        break;
      default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
        break;
    }
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:35,代码来源:gtkcellview.c

示例10: gtk_cell_view_get_property

static void
gtk_cell_view_get_property (GObject    *object,
                            guint       param_id,
                            GValue     *value,
                            GParamSpec *pspec)
{
  GtkCellView *view = GTK_CELL_VIEW (object);

  switch (param_id)
    {
      case PROP_BACKGROUND_GDK:
        {
          GdkColor color;

          color = view->priv->background;

          g_value_set_boxed (value, &color);
        }
        break;
      case PROP_BACKGROUND_SET:
        g_value_set_boolean (value, view->priv->background_set);
        break;
      default:
        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
        break;
    }
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:27,代码来源:gtkcellview.c

示例11: attachment_button_update_cell_view

static void
attachment_button_update_cell_view (EAttachmentButton *button)
{
	GtkCellView *cell_view;
	EAttachment *attachment;
	GtkTreeRowReference *reference;
	GtkTreeModel *model = NULL;
	GtkTreePath *path = NULL;

	cell_view = GTK_CELL_VIEW (button->priv->cell_view);

	attachment = e_attachment_button_get_attachment (button);
	if (attachment == NULL)
		goto exit;

	reference = e_attachment_get_reference (attachment);
	if (reference == NULL)
		goto exit;

	model = gtk_tree_row_reference_get_model (reference);
	path = gtk_tree_row_reference_get_path (reference);

exit:

	gtk_cell_view_set_model (cell_view, model);
	if (model)
		gtk_cell_view_set_displayed_row (cell_view, path);

	if (path != NULL)
		gtk_tree_path_free (path);
}
开发者ID:Distrotech,项目名称:evolution,代码行数:31,代码来源:e-attachment-button.c

示例12: cell_view_init

/**
 * Initialize the head cellview, create list store and set the cell renderers.
 */
static void
cell_view_init(HybridHead *head)
{
	GtkListStore *store;
	GtkCellRenderer *renderer;
	GtkTreePath *path;

	g_return_if_fail(head != NULL);

	store = gtk_list_store_new(HYBRID_HEAD_COLUMNS,
								GDK_TYPE_PIXBUF,
								G_TYPE_STRING,
								GDK_TYPE_PIXBUF);

	gtk_cell_view_set_model(GTK_CELL_VIEW(head->cellview), GTK_TREE_MODEL(store));

	g_object_unref(store);

	/* buddy icon renderer */
	renderer = gtk_cell_renderer_pixbuf_new();
	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(head->cellview), renderer, FALSE);
	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(head->cellview), renderer,
			"pixbuf", HYBRID_HEAD_PIXBUF_COLUMN, NULL);
	g_object_set(renderer, "yalign", 0.5, "xpad", 3, "ypad", 0, NULL);

	/* buddy name renderer */
	renderer = gtk_cell_renderer_text_new();
	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(head->cellview), renderer, TRUE);
	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(head->cellview), renderer,
			"markup", HYBRID_HEAD_NAME_COLUMN, NULL);

	g_object_set(renderer, "xalign", 0.0, "yalign", 0.0, "xpad", 6, "ypad", 0, NULL);
	g_object_set(renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);

	/* status icon renderer */
	renderer = gtk_cell_renderer_pixbuf_new();
	gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(head->cellview), renderer, FALSE);
	gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(head->cellview), renderer,
			"pixbuf", HYBRID_HEAD_STATUS_ICON_COLUMN, NULL);
	g_object_set(renderer, "yalign", 0.5, "xpad", 10, "ypad", 0, NULL);

	gtk_list_store_append(store, &head->iter);
	path = gtk_tree_path_new_from_string("0");
	gtk_cell_view_set_displayed_row(GTK_CELL_VIEW(head->cellview), path);
	gtk_tree_path_free(path);
}
开发者ID:chenyukang,项目名称:hybrid,代码行数:49,代码来源:head.c

示例13: gtk_cell_view_get_request_mode

static GtkSizeRequestMode 
gtk_cell_view_get_request_mode (GtkWidget *widget)
{
  GtkCellView        *cellview = GTK_CELL_VIEW (widget);
  GtkCellViewPrivate *priv = cellview->priv;

  return gtk_cell_area_get_request_mode (priv->area);
}
开发者ID:Sidnioulz,项目名称:SandboxGtk,代码行数:8,代码来源:gtkcellview.c

示例14: gtk_cell_view_new

/* public API */
GtkWidget *
gtk_cell_view_new (void)
{
  GtkCellView *cellview;

  cellview = GTK_CELL_VIEW (g_object_new (gtk_cell_view_get_type (), NULL));

  return GTK_WIDGET (cellview);
}
开发者ID:bf4,项目名称:pidgin-mac,代码行数:10,代码来源:gtkcellview.c

示例15: gtk_cell_view_set_background_rgba

 //________________________________________________________________________________
 void ComboBoxData::updateCellViewColor( void ) const
 {
     // change background color
     if( _cell._widget )
     {
         const GdkRGBA color = { 0, 0, 0, 0 };
         gtk_cell_view_set_background_rgba( GTK_CELL_VIEW( _cell._widget ), &color );
     }
 }
开发者ID:ds9-extras,项目名称:carbon-gtk3,代码行数:10,代码来源:carboncomboboxdata.cpp


注:本文中的GTK_CELL_VIEW函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。