• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GTK_TREE_VIEW_COLUMN函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: preferences_languages_setup

static void
preferences_languages_setup (EmpathyPreferences *preferences)
{
	EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
	GtkTreeView       *view;
	GtkListStore      *store;
	GtkTreeSelection  *selection;
	GtkTreeViewColumn *column;
	GtkCellRenderer   *renderer;
	guint              col_offset;

	view = GTK_TREE_VIEW (priv->treeview_spell_checker);

	store = gtk_list_store_new (COL_LANG_COUNT,
				    G_TYPE_BOOLEAN,  /* enabled */
				    G_TYPE_STRING,   /* code */
				    G_TYPE_STRING);  /* name */

	gtk_tree_view_set_model (view, GTK_TREE_MODEL (store));

	selection = gtk_tree_view_get_selection (view);
	gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);

	renderer = gtk_cell_renderer_toggle_new ();
	g_signal_connect (renderer, "toggled",
			  G_CALLBACK (preferences_languages_cell_toggled_cb),
			  preferences);

	column = gtk_tree_view_column_new_with_attributes (NULL, renderer,
							   "active", COL_LANG_ENABLED,
							   NULL);

	gtk_tree_view_append_column (view, column);

	renderer = gtk_cell_renderer_text_new ();
	col_offset = gtk_tree_view_insert_column_with_attributes (view,
								  -1, _("Language"),
								  renderer,
								  "text", COL_LANG_NAME,
								  NULL);

	g_object_set_data (G_OBJECT (renderer),
			   "column", GINT_TO_POINTER (COL_LANG_NAME));

	column = gtk_tree_view_get_column (view, col_offset - 1);
	gtk_tree_view_column_set_sort_column_id (column, COL_LANG_NAME);
	gtk_tree_view_column_set_resizable (column, FALSE);
	gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);

	g_object_unref (store);
}
开发者ID:raluca-elena,项目名称:empathy-cheese,代码行数:51,代码来源:empathy-preferences.c


示例2: glade_gtk_treeview_set_child_property

void
glade_gtk_treeview_set_child_property (GladeWidgetAdaptor * adaptor,
                                       GObject * container,
                                       GObject * child,
                                       const gchar * property_name,
                                       const GValue * value)
{
  if (strcmp (property_name, "position") == 0)
    {

      gtk_tree_view_remove_column (GTK_TREE_VIEW (container),
                                   GTK_TREE_VIEW_COLUMN (child));
      gtk_tree_view_insert_column (GTK_TREE_VIEW (container),
                                   GTK_TREE_VIEW_COLUMN (child),
                                   g_value_get_int (value));
    }
  else
    /* Chain Up */
    GWA_GET_CLASS
        (GTK_TYPE_CONTAINER)->child_set_property (adaptor,
                                                  container, child,
                                                  property_name, value);
}
开发者ID:kugel-,项目名称:glade,代码行数:23,代码来源:glade-gtk-tree-view.c


示例3: csv_import_header_on_click

/**
 * Triggered when user clicks on a column header.  Create and pop up a
 * menu to allow CSV config change.
 *
 * \param button	Button placed at the title column.
 * \param ev		Not used.
 * \param no_column	Position of the column.
 *
 * \return		FALSE
 */
gboolean csv_import_header_on_click ( GtkWidget * button, gint *no_column )
{
    GtkWidget * menu, * col;

    col = g_object_get_data ( G_OBJECT ( button ), "column" );

    menu = csv_import_fields_menu ( GTK_TREE_VIEW_COLUMN ( col ),
				    GPOINTER_TO_INT ( no_column ),
				    g_object_get_data ( G_OBJECT(col), "assistant" ) );
    gtk_menu_popup ( GTK_MENU(menu), NULL, NULL, NULL, NULL, 3,
		     gtk_get_current_event_time());

    return FALSE;
}
开发者ID:wazari972,项目名称:Grisbi,代码行数:24,代码来源:import_csv.c


示例4: gzrt_wmain_tree_generate

/* Generate the tree view */
GtkWidget * 
gzrt_wmain_tree_generate ( MAINWIN * c )
{
    GtkWidget    * menu = menu_generate( c );
	GtkWidget    * tv = gtk_tree_view_new();
	GtkListStore * ls = gtk_list_store_new( sizeof(Cols) / sizeof(struct ColumnSpec), G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, -1 );
	
	/* Right click handler */
	g_signal_connect(tv, "button-press-event", G_CALLBACK(click_handler), (gpointer)menu);
	
	/* Create columns */
	for( int i = 0; i < sizeof(Cols) / sizeof(struct ColumnSpec); i++ )
	{
		GtkCellRenderer * r = gtk_cell_renderer_text_new();
		GtkTreeViewColumn * col;
		
		/* Font? */
		if( Cols[i].font )
			g_object_set( G_OBJECT(r), "font", FONT, NULL );
		
		gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW(tv), 
		-1, Cols[i].title, r, "text", i, NULL );
		col = gtk_tree_view_get_column( GTK_TREE_VIEW(tv), i );
		gtk_tree_view_column_set_resizable( col, TRUE );
		
		if( i == 1 )
		gtk_tree_view_column_set_expand( GTK_TREE_VIEW_COLUMN(col), TRUE );
	}
	
	/* Generate data */
	for( int i = 0; i < z64fs_entries( c->z->fs ); i++ )
	{
		GtkTreeIter j;
		
		gtk_list_store_append( GTK_LIST_STORE(ls), &j );
		 
		for( int k = 0; k < sizeof(Cols) / sizeof(struct ColumnSpec); k++ )
		{
			char buffer[64];
			Cols[k].func( buffer, i, c );
			gtk_list_store_set( GTK_LIST_STORE(ls), &j, k, buffer, -1 );
		}
	}
	
	/* Set model */
	gtk_tree_view_set_model( GTK_TREE_VIEW(tv), GTK_TREE_MODEL(ls) );
	
	/* Return it */
	return tv;
}
开发者ID:wareya,项目名称:gzrt,代码行数:51,代码来源:list.c


示例5: fx_many_create_all_column

static void fx_many_create_all_column(FxMany* fxmany)
{
	GtkCellRenderer* renderer;
	GtkTreeViewColumn *col , *col1;
	GtkWidget* tree = fxmany->tree;

	renderer = gtk_cell_renderer_toggle_new();
	g_signal_connect(renderer , "toggled" , G_CALLBACK(fx_many_item_toggled) , fxmany);
	col = gtk_tree_view_column_new();
	gtk_tree_view_column_pack_start(col , renderer , TRUE);
	gtk_tree_view_column_add_attribute(col, renderer, "active", S_CHECK_COL);
	gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (col)
								   , GTK_TREE_VIEW_COLUMN_FIXED);
	gtk_tree_view_column_set_fixed_width (GTK_TREE_VIEW_COLUMN (col), 40);
	gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (col), TRUE);
	gtk_tree_view_append_column(GTK_TREE_VIEW(tree) , col);

	renderer = gtk_cell_renderer_pixbuf_new();

	GtkTreeViewColumn* col0 = gtk_tree_view_column_new(); 
    gtk_tree_view_column_pack_start(col0, renderer , FALSE);
	gtk_tree_view_column_add_attribute(col0, renderer, "pixbuf", S_PIXBUF_COL);
	gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col0);

    renderer = gtk_cell_renderer_text_new();
    col1 = gtk_tree_view_column_new(); 
    gtk_tree_view_column_pack_start(col1, renderer , FALSE);
	gtk_tree_view_column_set_cell_data_func(col1
										  , renderer
										  , fx_many_text_cell_data_func
										  , NULL
										  , NULL);
	gtk_tree_view_append_column(GTK_TREE_VIEW(tree), col1);
	gtk_tree_view_column_set_sizing (GTK_TREE_VIEW_COLUMN (col)
								   , GTK_TREE_VIEW_COLUMN_FIXED);

}
开发者ID:amoblin,项目名称:flyshion,代码行数:37,代码来源:fx_many.c


示例6: init_left_tree

void init_left_tree(void)
{
	GtkTreeView *view = GTK_TREE_VIEW(tree1_w);
	GtkCellRenderer *renderer;
	GtkTreeSelection *sel;
	GtkTreeViewColumn *column;

	gtk_tree_view_set_model(view, model1);
	gtk_tree_view_set_headers_visible(view, TRUE);
	gtk_tree_view_set_rules_hint(view, FALSE);
	
	column = gtk_tree_view_column_new();
	gtk_tree_view_append_column(view, column);
	gtk_tree_view_column_set_title(column, _("Options"));

	renderer = gtk_cell_renderer_toggle_new();
	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
					renderer, FALSE);
	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
					    renderer,
					    "active", COL_BTNACT,
					    "inconsistent", COL_BTNINC,
					    "visible", COL_BTNVIS, 
					    "radio", COL_BTNRAD, NULL);
	renderer = gtk_cell_renderer_text_new();
	gtk_tree_view_column_pack_start(GTK_TREE_VIEW_COLUMN(column),
					renderer, FALSE);	
	gtk_tree_view_column_set_attributes(GTK_TREE_VIEW_COLUMN(column),
					    renderer,
					    "text", COL_OPTION,
					    "foreground-gdk",
					    COL_COLOR, NULL);

	sel = gtk_tree_view_get_selection(view);
	gtk_tree_selection_set_mode(sel, GTK_SELECTION_SINGLE);
	gtk_widget_realize(tree1_w);
}
开发者ID:OpenHMR,项目名称:Open-HMR600,代码行数:37,代码来源:gconf.c


示例7: bind_chapter_tree_model

// Create and bind the tree model to the tree view for the chapter list
// Also, connect up the signal that lets us know the selection has changed
static void
bind_chapter_tree_model(signal_user_data_t *ud)
{
    GtkCellRenderer *cell;
    GtkTreeViewColumn *column;
    GtkListStore *treestore;
    GtkTreeView  *treeview;

    g_debug("bind_chapter_tree_model()\n");
    treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "chapters_list"));
    treestore = gtk_list_store_new(5, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
    gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(treestore));

    cell = ghb_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes(
                                    _("Index"), cell, "text", 0, NULL);
    gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));

    cell = ghb_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes(
                                    _("Start"), cell, "text", 1, NULL);
    gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));

    cell = ghb_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes(
                                    _("Duration"), cell, "text", 2, NULL);
    gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));

    cell = ghb_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes(
                    _("Title"), cell, "text", 3, "editable", 4, NULL);
    gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));

    g_signal_connect(cell, "key-press-event", chapter_keypress_cb, ud);
    g_signal_connect(cell, "edited", chapter_edited_cb, ud);
    g_debug("Done\n");
}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:39,代码来源:main.c


示例8: refresh_log

static void
refresh_log (GitLogPane *self)
{
	Git *plugin;
	GtkTreeView *log_view;
	GtkTreeViewColumn *graph_column;

	plugin = ANJUTA_PLUGIN_GIT (anjuta_dock_pane_get_plugin (ANJUTA_DOCK_PANE (self)));
	log_view = GTK_TREE_VIEW (gtk_builder_get_object (self->priv->builder,
	                                                  "log_view"));
	graph_column = GTK_TREE_VIEW_COLUMN (gtk_builder_get_object (self->priv->builder,
	                                                             "graph_column"));

	/* Unref the previous command if it's still running. */
	if (self->priv->log_command)
		g_object_unref (self->priv->log_command);

	gtk_tree_view_set_model (log_view, NULL);

	/* We don't support filters for now */
	self->priv->log_command = git_log_command_new (plugin->project_root_directory,
	                                               self->priv->selected_branch,
	                                               self->priv->path,
	                                               NULL,
	                                               NULL,
	                                               NULL,
	                                               NULL,
	                                               NULL,
	                                               NULL);

	/* Hide the graph column if we're looking at the log of a path. The graph
	 * won't be correct in this case. */
	if (self->priv->path)
		gtk_tree_view_column_set_visible (graph_column, FALSE);
	else
		gtk_tree_view_column_set_visible (graph_column, TRUE);

	g_signal_connect_object (G_OBJECT (self->priv->log_command), "command-finished",
	                         G_CALLBACK (on_log_command_finished),
	                         self, 0);

	gtk_list_store_clear (self->priv->log_model);

	/* Show the loading spinner */
	git_log_pane_set_view_mode (self, LOG_VIEW_LOADING);

	anjuta_command_start (ANJUTA_COMMAND (self->priv->log_command));
}
开发者ID:VujinovM,项目名称:anjuta,代码行数:48,代码来源:git-log-pane.c


示例9: gtk_scrolled_window_new

/* Create the list of "messages" */
static GtkWidget *create_list( void )
{

    GtkWidget *scrolled_window;
    GtkWidget *tree_view;
    GtkListStore *model;
    GtkTreeIter iter;
    GtkCellRenderer *cell;
    GtkTreeViewColumn *column;

    int i;
   
    /* Create a new scrolled window, with scrollbars only if needed */
    scrolled_window = gtk_scrolled_window_new (NULL, NULL);
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
				    GTK_POLICY_AUTOMATIC, 
				    GTK_POLICY_AUTOMATIC);
   
    model = gtk_list_store_new (1, G_TYPE_STRING);
    tree_view = gtk_tree_view_new ();
    gtk_container_add (GTK_CONTAINER (scrolled_window), tree_view);
    gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model));
    gtk_widget_show (tree_view);
   
    /* Add some messages to the window */
    for (i = 0; i < 10; i++) {
        gchar *msg = g_strdup_printf ("Message #%d", i);
        gtk_list_store_append (GTK_LIST_STORE (model), &iter);
        gtk_list_store_set (GTK_LIST_STORE (model), 
	                    &iter,
                            0, msg,
	                    -1);
	g_free (msg);
    }
   
    cell = gtk_cell_renderer_text_new ();

    column = gtk_tree_view_column_new_with_attributes ("Messages",
                                                       cell,
                                                       "text", 0,
                                                       NULL);
  
    gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
	  		         GTK_TREE_VIEW_COLUMN (column));

    return scrolled_window;
}
开发者ID:ombt,项目名称:ombt,代码行数:48,代码来源:t24.cpp


示例10: create_tree

/* Technically a list, but if we do go to 80 demos, we may want to move to a tree */
static GtkWidget *
create_tree (void)
{
  GtkTreeSelection *selection;
  GtkCellRenderer *cell;
  GtkWidget *tree_view;
  GtkTreeViewColumn *column;
  GtkTreeStore *model;
  GtkTreeIter iter;
  gint i;

  model = gtk_tree_store_new_with_types (NUM_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_BOOLEAN);
  tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));

  gtk_tree_selection_set_type (GTK_TREE_SELECTION (selection),
			       GTK_TREE_SELECTION_SINGLE);
  gtk_widget_set_usize (tree_view, 200, -1);

  for (i=0; i < G_N_ELEMENTS (testgtk_demos); i++)
    {
      gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);

      gtk_tree_store_set (GTK_TREE_STORE (model),
			  &iter,
			  TITLE_COLUMN, testgtk_demos[i].title,
			  FILENAME_COLUMN, testgtk_demos[i].filename,
			  FUNC_COLUMN, testgtk_demos[i].func,
			  ITALIC_COLUMN, FALSE,
			  -1);
    }

  cell = gtk_cell_renderer_text_new ();
  column = gtk_tree_view_column_new_with_attributes ("Widget",
						     cell,
						     "text", TITLE_COLUMN,
						     "italic", ITALIC_COLUMN,
						     NULL);
  gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
			       GTK_TREE_VIEW_COLUMN (column));

  g_signal_connect (selection, "selection-changed", selection_cb, model);
  g_signal_connect (tree_view, "button-press-event", G_CALLBACK (button_press_event_cb), model);

  return tree_view;
}
开发者ID:chipx86,项目名称:gtk,代码行数:47,代码来源:main.c


示例11: bind_presets_tree_model

// Create and bind the tree model to the tree view for the preset list
// Also, connect up the signal that lets us know the selection has changed
static void
bind_presets_tree_model(signal_user_data_t *ud)
{
    GtkCellRenderer *cell;
    GtkTreeViewColumn *column;
    GtkTreeStore *treestore;
    GtkTreeView  *treeview;
    GtkTreeSelection *selection;
    GtkWidget *widget;
    GtkTargetEntry SrcEntry;
    SrcEntry.target = "DATA";
    SrcEntry.flags = GTK_TARGET_SAME_WIDGET;

    g_debug("bind_presets_tree_model()\n");
    treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
    selection = gtk_tree_view_get_selection(treeview);
    treestore = gtk_tree_store_new(6, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT,
                                  G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
    gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(treestore));

    cell = gtk_cell_renderer_text_new();
    column = gtk_tree_view_column_new_with_attributes(_("Preset Name"), cell,
        "text", 0, "weight", 1, "style", 2,
        "foreground", 3, "editable", 5, NULL);

    g_signal_connect(cell, "edited", preset_edited_cb, ud);

    gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
    gtk_tree_view_column_set_expand(column, TRUE);
    gtk_tree_view_set_tooltip_column(treeview, 4);

    gtk_tree_view_enable_model_drag_dest(treeview, &SrcEntry, 1,
                                            GDK_ACTION_MOVE);
    gtk_tree_view_enable_model_drag_source(treeview, GDK_BUTTON1_MASK,
                                            &SrcEntry, 1, GDK_ACTION_MOVE);

    g_signal_connect(treeview, "drag_data_received", presets_drag_cb, ud);
    g_signal_connect(treeview, "drag_motion", presets_drag_motion_cb, ud);
    g_signal_connect(treeview, "row_expanded", presets_row_expanded_cb, ud);
    g_signal_connect(treeview, "row_collapsed", presets_row_expanded_cb, ud);
    g_signal_connect(selection, "changed", presets_list_selection_changed_cb, ud);
    widget = GHB_WIDGET(ud->builder, "presets_remove");
    gtk_widget_set_sensitive(widget, FALSE);
    g_debug("Done\n");
}
开发者ID:TotalCaesar659,项目名称:HandBrake,代码行数:47,代码来源:main.c


示例12: create_profile_list

/* create a profile list widget */
static GtkWidget*
create_profile_list (void)
{
  GtkTreeSelection *selection;
  GtkCellRenderer *cell;
  GtkWidget *tree_view;
  GtkTreeViewColumn *column;
  GtkListStore *model;

  model = gtk_list_store_new (COLUMN_LAST,
                              G_TYPE_STRING,
                              G_TYPE_OBJECT);

  tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
  //terminal_util_set_atk_name_description (tree_view, _("Profile list"), NULL);

  g_object_unref (G_OBJECT (model));

  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));

  gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
                               GTK_SELECTION_MULTIPLE);

  refill_profile_treeview (tree_view);

  cell = gtk_cell_renderer_text_new ();

  g_object_set (G_OBJECT (cell),
                "xpad", 2,
                NULL);

  column = gtk_tree_view_column_new_with_attributes (NULL,
                                                     cell,
                                                     "text", COLUMN_NAME,
                                                     NULL);

  gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
                               GTK_TREE_VIEW_COLUMN (column));

  gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tree_view), FALSE);

  return tree_view;
}
开发者ID:benpicco,项目名称:libmate-media-profiles,代码行数:44,代码来源:audio-profiles-edit.c


示例13: gtk_scrolled_window_new

void ListBox::create(Window &parent, unsigned x, unsigned y, unsigned width, unsigned height, const char *text) {
  listBox->selection = -1;
  object->widget = gtk_scrolled_window_new(0, 0);
  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(object->widget), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
  gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(object->widget), GTK_SHADOW_ETCHED_IN);
  gtk_widget_set_size_request(object->widget, width, height);

  lstring list;
  list.split("\t", text);

  GType *v = (GType*)malloc(list.size() * sizeof(GType));
  for(unsigned i = 0; i < list.size(); i++) v[i] = G_TYPE_STRING;
  listBox->store = gtk_list_store_newv(list.size(), v);
  free(v);

  object->subWidget = gtk_tree_view_new_with_model(GTK_TREE_MODEL(listBox->store));
  gtk_container_add(GTK_CONTAINER(object->widget), object->subWidget);
  g_object_unref(G_OBJECT(listBox->store));

  //alternate color of each row if there is more than one column
  gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(object->subWidget), list.size() >= 2);
  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(object->subWidget), false);

  for(unsigned i = 0; i < list.size(); i++) {
    listBox->column[i].renderer = gtk_cell_renderer_text_new();
    listBox->column[i].column = gtk_tree_view_column_new_with_attributes(
      list[i], listBox->column[i].renderer, "text", i, (void*)0
    );
    listBox->column[i].label = gtk_label_new(list[i]);
    gtk_tree_view_column_set_widget(GTK_TREE_VIEW_COLUMN(listBox->column[i].column), listBox->column[i].label);
    gtk_tree_view_append_column(GTK_TREE_VIEW(object->subWidget), listBox->column[i].column);
    gtk_widget_show(listBox->column[i].label);
  }

  g_signal_connect_swapped(G_OBJECT(object->subWidget), "cursor-changed", G_CALLBACK(ListBox_change), (gpointer)this);
  g_signal_connect_swapped(G_OBJECT(object->subWidget), "row-activated", G_CALLBACK(ListBox_activate), (gpointer)this);

  if(parent.window->defaultFont) setFont(*parent.window->defaultFont);
  gtk_fixed_put(GTK_FIXED(parent.object->formContainer), object->widget, x, y);
  gtk_widget_show(object->subWidget);
  gtk_widget_show(object->widget);
}
开发者ID:gilligan,项目名称:bsnes,代码行数:42,代码来源:listbox.cpp


示例14: col_edited_helper

static void col_edited_helper(GtkCellRendererText *cell, gchar *path_string,
                              gchar *new_text, gpointer _s_model)
{
    GncOwner *owner;
    GtkTreeModel *s_model;
    GtkTreeIter s_iter;
    GncTreeViewOwnerColumnTextEdited col_edited_cb;
    GtkTreeViewColumn *col;

    col_edited_cb = g_object_get_data(G_OBJECT(cell),
                                      "column_edited_callback");
    col = GTK_TREE_VIEW_COLUMN(g_object_get_data(G_OBJECT(cell),
                               "column_view"));
    s_model = GTK_TREE_MODEL(_s_model);

    if (!gtk_tree_model_get_iter_from_string(s_model, &s_iter, path_string))
        return;

    owner = gnc_tree_view_owner_get_owner_from_iter(s_model, &s_iter);
    col_edited_cb(owner, col, new_text);
}
开发者ID:nishmu,项目名称:gnucash,代码行数:21,代码来源:gnc-tree-view-owner.c


示例15: list_store_set_sort_all

void
list_store_set_sort_all(GtkWidget *tview)
{
  GList *list, *ptr;
  int i;
  GtkTreeViewColumn *column;

  list = gtk_tree_view_get_columns(GTK_TREE_VIEW(tview));

  if (list == NULL)
    return;

  for (ptr = list, i = 0; ptr; ptr = ptr->next, i++) {
    column = GTK_TREE_VIEW_COLUMN(ptr->data);
    gtk_tree_view_column_set_sort_column_id(column, i);
    gtk_tree_view_column_set_clickable(column, TRUE);
  }

  gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tview), TRUE);
  g_list_free(list);
}
开发者ID:htrb,项目名称:ngraph-gtk,代码行数:21,代码来源:gtk_liststore.c


示例16: skin_view_realize

void
skin_view_realize(GtkTreeView * treeview)
{
    GtkListStore *store;
    GtkTreeViewColumn *column;
    GtkCellRenderer *renderer;
    GtkTreeSelection *selection;

    gtk_widget_show_all(GTK_WIDGET(treeview));

    gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE);
    gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE);

    store = gtk_list_store_new(SKIN_VIEW_N_COLS, GDK_TYPE_PIXBUF,
                               G_TYPE_STRING , G_TYPE_STRING);
    gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(store));
    g_object_unref (store);

    column = gtk_tree_view_column_new();
    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
    gtk_tree_view_column_set_spacing(column, 16);
    gtk_tree_view_append_column(GTK_TREE_VIEW(treeview),
                                GTK_TREE_VIEW_COLUMN(column));

    renderer = gtk_cell_renderer_pixbuf_new();
    gtk_tree_view_column_pack_start(column, renderer, FALSE);
    gtk_tree_view_column_set_attributes(column, renderer, "pixbuf",
                                        SKIN_VIEW_COL_PREVIEW, NULL);

    renderer = gtk_cell_renderer_text_new();
    gtk_tree_view_column_pack_start(column, renderer, TRUE);
    gtk_tree_view_column_set_attributes(column, renderer, "markup",
                                        SKIN_VIEW_COL_FORMATTEDNAME, NULL);

    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview));
    gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);

    g_signal_connect(treeview, "cursor-changed",
                     G_CALLBACK(skin_view_on_cursor_changed), NULL);
}
开发者ID:ivan-dives,项目名称:audacious-plugins,代码行数:40,代码来源:ui_skinselector.c


示例17: preferences_sound_setup

static void
preferences_sound_setup (EmpathyPreferences *preferences)
{
	EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
	GtkTreeView *view;
	GtkListStore *store;
	GtkCellRenderer *renderer;
	GtkTreeViewColumn *column;

	view = GTK_TREE_VIEW (priv->treeview_sounds);

	store = gtk_list_store_new (COL_SOUND_COUNT,
				    G_TYPE_BOOLEAN, /* enabled */
				    G_TYPE_STRING,  /* name */
				    G_TYPE_STRING); /* key */

	gtk_tree_view_set_model (view, GTK_TREE_MODEL (store));

	renderer = gtk_cell_renderer_toggle_new ();
	g_signal_connect (renderer, "toggled",
			  G_CALLBACK (preferences_sound_cell_toggled_cb),
			  preferences);

	column = gtk_tree_view_column_new ();
	gtk_tree_view_column_pack_start (column, renderer, FALSE);
	gtk_tree_view_column_add_attribute (column, renderer,
					    "active", COL_SOUND_ENABLED);

	renderer = gtk_cell_renderer_text_new ();
	gtk_tree_view_column_pack_start (column, renderer, FALSE);
	gtk_tree_view_column_add_attribute (column, renderer,
					    "text", COL_SOUND_NAME);

	gtk_tree_view_append_column (view, column);

	gtk_tree_view_column_set_resizable (column, FALSE);
	gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);

	g_object_unref (store);
}
开发者ID:DylanMcCall,项目名称:Empathy---Hide-contact-groups,代码行数:40,代码来源:empathy-preferences.c


示例18: contact_widget_model_populate_columns

static void
contact_widget_model_populate_columns (EmpathyContactWidget *information)
{
  GtkTreeView *view;
  GtkTreeModel *model;
  GtkTreeViewColumn *column;
  GtkCellRenderer  *renderer;
  guint col_offset;

  view = GTK_TREE_VIEW (information->treeview_groups);
  model = gtk_tree_view_get_model (view);

  renderer = gtk_cell_renderer_toggle_new ();
  g_signal_connect (renderer, "toggled",
      G_CALLBACK (contact_widget_cell_toggled), information);

  column = gtk_tree_view_column_new_with_attributes (_("Select"), renderer,
      "active", COL_ENABLED, NULL);

  gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
  gtk_tree_view_column_set_fixed_width (column, 50);
  gtk_tree_view_append_column (view, column);

  renderer = gtk_cell_renderer_text_new ();
  col_offset = gtk_tree_view_insert_column_with_attributes (view,
      -1, _("Group"),
      renderer,
      "text", COL_NAME,
      /* "editable", COL_EDITABLE, */
      NULL);

  g_object_set_data (G_OBJECT (renderer),
      "column", GINT_TO_POINTER (COL_NAME));

  column = gtk_tree_view_get_column (view, col_offset - 1);
  gtk_tree_view_column_set_sort_column_id (column, COL_NAME);
  gtk_tree_view_column_set_resizable (column,FALSE);
  gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (column), TRUE);
}
开发者ID:kenvandine,项目名称:empathy,代码行数:39,代码来源:empathy-contact-widget.c


示例19: clearlooks_treeview_get_header_index

void clearlooks_treeview_get_header_index (GtkTreeView *tv, GtkWidget *header,
                                    gint *column_index, gint *columns,
                                    gboolean *resizable)
{
	GList *list, *list_start;
	*column_index = *columns = 0;
	list_start = list = gtk_tree_view_get_columns (tv);

	do
	{
		GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN(list->data);
		if ( column->button == header )
		{
			*column_index = *columns;
			*resizable = column->resizable;
		}
		if ( column->visible )
			(*columns)++;
	} while ((list = g_list_next(list)));

	g_list_free (list_start);
}
开发者ID:DanielAeolusLaude,项目名称:ardour,代码行数:22,代码来源:support.c


示例20: reset_sort_order

static void
reset_sort_order (FsearchApplicationWindow *win)
{
    g_assert (FSEARCH_WINDOW_IS_WINDOW (win));

    GList *list = gtk_tree_view_get_columns (GTK_TREE_VIEW (win->listview));
    GList *l;
    for (l = list; l != NULL; l = l->next)
    {
        GtkTreeViewColumn *col = GTK_TREE_VIEW_COLUMN (l->data);
        if (l == list) {
            gtk_tree_view_column_set_sort_order (col, GTK_SORT_ASCENDING);
            gtk_tree_view_column_set_sort_indicator (col, TRUE);
            gtk_tree_view_column_set_sort_column_id (col, SORT_ID_NAME);
        }
        else {
            gtk_tree_view_column_set_sort_order (col, GTK_SORT_ASCENDING);
            gtk_tree_view_column_set_sort_indicator (col, FALSE);
        }
    }
    g_list_free (list);
}
开发者ID:cboxdoerfer,项目名称:fsearch,代码行数:22,代码来源:fsearch_window.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_UI_MANAGER函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_TREE_VIEW函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap