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


C++ GTK_TREE_STORE函数代码示例

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


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

示例1: add_item

static void add_item (int is_folder)
{
    GtkTreeIter iter;
    GtkTreeModel *model;
    gftp2_bookmark *new_item;
    GNode *new_node;
  
    new_item = gftp2_bookmark_new ();
    if (is_folder)
        new_item->name = g_strdup ("(New folder)");
    else
        new_item->name = g_strdup ("(New bookmark)");
    new_item->is_folder = is_folder;
    new_node = g_node_new (new_item);
    g_node_append (bookmark_root, new_node);

    gtk_tree_store_append (GTK_TREE_STORE (editor->store), &iter, NULL);
    gtk_tree_store_set (GTK_TREE_STORE (editor->store), &iter,
                        COLUMN_NAME, new_item->name,
                        COLUMN_ENTRY, new_node, -1);

    editor->changed = 1;
    gtk_widget_set_sensitive (GTK_WIDGET (editor->save_button), TRUE);
}
开发者ID:Sohil876,项目名称:gftp2,代码行数:24,代码来源:bmeditor.c

示例2: update_node_name_func

static gboolean update_node_name_func(GtkTreeModel *model, GtkTreePath *path,
				      GtkTreeIter *iter, gpointer data)
{
	MimeInfo *partinfo;
	gchar *part_name;

	gtk_tree_model_get(model, iter, COL_MIME_INFO, &partinfo, -1);
	g_return_val_if_fail(partinfo != NULL, FALSE);

	part_name = get_part_name(partinfo);
	gtk_tree_store_set(GTK_TREE_STORE(model), iter, COL_NAME, part_name,
			   -1);

	return FALSE;
}
开发者ID:katakk,项目名称:sylpheed,代码行数:15,代码来源:mimeview.c

示例3: on_commit_status_data_arrived

static void
on_commit_status_data_arrived (AnjutaCommand *command, 
                               GitStatusPane *self)
{
	GtkTreeStore *status_model;
	GQueue *output;

	status_model = GTK_TREE_STORE (gtk_builder_get_object (self->priv->builder,
	                                                       "status_model"));
	output = git_status_command_get_status_queue (GIT_STATUS_COMMAND (command));

	add_status_items (output, status_model, &(self->priv->commit_iter),
	                  STATUS_TYPE_COMMIT);

}
开发者ID:kyoushuu,项目名称:anjuta,代码行数:15,代码来源:git-status-pane.c

示例4: del_signal

//удалить элемент списка
void del_signal(GtkWidget* b, gpointer data)
{
    GtkTreeIter iter;
    //список GtkTreeView
    GtkTreeView *treeview = (GtkTreeView *)data;
    
    GtkTreeModel *model = gtk_tree_view_get_model (treeview);
    
    //получить выделенную ячейку и удалить её
    GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview);
    if (gtk_tree_selection_get_selected (selection, NULL, &iter))
    {
        gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
    }
}
开发者ID:zlv,项目名称:SpamTeacher,代码行数:16,代码来源:gui.cpp

示例5: gtk_tree_store_append

orcaData orcaGtkIter::ex_push_child(orcaVM* vm, int n)/*{{{*/
{
	if (n<1) vm->need_param();

	GtkTreeIter iter;
	gtk_tree_store_append(GTK_TREE_STORE(m_gp->store), &iter, &m_iter);

	orcaList* lp = castobj<orcaList>(vm->get_param(0));
	if (lp == NULL) {
		throw orcaException(vm, "orca.type", "list type is required");
	}

	set_list_to_store(lp, m_gp->store, &iter, m_type);
	return NIL;
}
开发者ID:lynix94,项目名称:orca-lang,代码行数:15,代码来源:orcaGtk.cpp

示例6: search_gui_clear_tree

static void
search_gui_clear_tree(search_t *search)
{
	GtkTreeModel *model;
	bool stopped;

	stopped = search_gui_start_massive_update(search);

	model = gtk_tree_view_get_model(GTK_TREE_VIEW(search->tree));
	gtk_tree_model_foreach(model, prepare_remove_record, search);
	gtk_tree_store_clear(GTK_TREE_STORE(model));

	if (stopped)
		search_gui_end_massive_update(search);
}
开发者ID:Longdengyu,项目名称:gtk-gnutella,代码行数:15,代码来源:search.c

示例7: on_enc_action_remove_btn_clicked

void
on_enc_action_remove_btn_clicked (GtkButton *button, gpointer user_data)
{
    GtkTreeModel		*model;
    GtkTreeSelection	*selection;
    GtkTreeIter		iter;
    gpointer		type;

    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (liferea_dialog_lookup (prefdialog->priv->dialog, "enc_action_view")));
    if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
        gtk_tree_model_get (model, &iter, FTS_PTR, &type, -1);
        gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
        enclosure_mime_type_remove (type);
    }
}
开发者ID:skagedal,项目名称:liferea,代码行数:15,代码来源:preferences_dialog.c

示例8: ghb_clear_subtitle_list_ui

static void
ghb_clear_subtitle_list_ui(GtkBuilder *builder)
{
    GtkTreeView *tv;
    GtkTreeStore *ts;
    GtkTreeSelection *tsel;

    tv = GTK_TREE_VIEW(GHB_WIDGET(builder, "subtitle_list"));
    ts = GTK_TREE_STORE(gtk_tree_view_get_model(tv));
    // Clear tree selection so that updates are not triggered
    // that cause a recursive attempt to clear the tree selection (crasher)
    tsel = gtk_tree_view_get_selection(tv);
    gtk_tree_selection_unselect_all(tsel);
    gtk_tree_store_clear(ts);
}
开发者ID:Doluci,项目名称:HandBrake,代码行数:15,代码来源:subtitlehandler.c

示例9: gftpui_add_file_to_transfer

void
gftpui_add_file_to_transfer (gftp_transfer * tdata, GList * curfle)
{
  char * status;
  gftp_file * fle;
  GtkTreeIter iter;

  fle = curfle->data;
  if (fle->transfer_action == GFTP_TRANS_ACTION_SKIP)
    status = _("Skipped");
  else
    status = _("Waiting...");

  g_print("%s\n", gftpui_gtk_get_utf8_file_pos (fle));

  GtkTreeModel * model = gtk_tree_view_get_model(GTK_TREE_VIEW (dlwdw));
  gtk_tree_store_append (GTK_TREE_STORE(model), &iter, tdata->user_data);
  gtk_tree_store_set(GTK_TREE_STORE(model), &iter,
    0, gftpui_gtk_get_utf8_file_pos (fle),
    1, status,
    2, tdata,
    3, curfle,
    -1);
}
开发者ID:pvtc,项目名称:gftp-gtk3,代码行数:24,代码来源:gtkui_transfer.c

示例10: add_family_to_list

/*Agrega las familias al cuado de familias */
void add_family_to_list(GtkWidget* widget,Familia* list){
	Familia *first = list;
	GtkTreeStore *store;
	store = GTK_TREE_STORE(gtk_tree_view_get_model     (GTK_TREE_VIEW(widget)));
	GtkTreeIter   iter;
	while(list != NULL){
		gtk_tree_store_append (store, &iter, NULL);
		gtk_tree_store_set (store, &iter,
					DATO, list->nomb_Familia,
					PUNTERO, list,
					-1);
		list = list->sig;
		}
	list = first;
	}
开发者ID:DKLeonard,项目名称:Arbol,代码行数:16,代码来源:main.c

示例11: ref_count_cleanup

static void
ref_count_cleanup (void)
{
  GtkTreeIter grandparent1, grandparent2, parent1, parent2;
  GtkTreeIter iter_parent1, iter_parent2;
  GtkTreeModel *model;
  GtkTreeModelRefCount *ref_model;
  GtkTreeModel *sort_model;
  GtkWidget *tree_view;

  model = gtk_tree_model_ref_count_new ();
  ref_model = GTK_TREE_MODEL_REF_COUNT (model);

  /* + grandparent1
   * + grandparent2
   *   + parent1
   *     + iter_parent1
   *   + parent2
   *     + iter_parent2
   *     + iter_parent2
   */

  gtk_tree_store_append (GTK_TREE_STORE (model), &grandparent1, NULL);
  gtk_tree_store_append (GTK_TREE_STORE (model), &grandparent2, NULL);
  gtk_tree_store_append (GTK_TREE_STORE (model), &parent1, &grandparent2);
  gtk_tree_store_append (GTK_TREE_STORE (model), &iter_parent1, &parent1);
  gtk_tree_store_append (GTK_TREE_STORE (model), &parent2, &grandparent2);
  gtk_tree_store_append (GTK_TREE_STORE (model), &iter_parent2, &parent2);
  gtk_tree_store_append (GTK_TREE_STORE (model), &iter_parent2, &parent2);

  sort_model = gtk_tree_model_sort_new_with_model (model);
  tree_view = gtk_tree_view_new_with_model (sort_model);

  gtk_tree_view_expand_all (GTK_TREE_VIEW (tree_view));

  gtk_widget_destroy (tree_view);

  assert_node_ref_count (ref_model, &grandparent1, 0);
  assert_node_ref_count (ref_model, &grandparent2, 1);
  assert_node_ref_count (ref_model, &parent1, 1);
  assert_node_ref_count (ref_model, &parent2, 1);
  assert_node_ref_count (ref_model, &iter_parent1, 0);
  assert_node_ref_count (ref_model, &iter_parent2, 0);

  gtk_tree_model_sort_clear_cache (GTK_TREE_MODEL_SORT (sort_model));

  assert_entire_model_unreferenced (ref_model);

  g_object_unref (sort_model);
  g_object_unref (ref_model);
}
开发者ID:Pfiver,项目名称:gtk,代码行数:51,代码来源:sortmodel.c

示例12: init_texture_list

void init_texture_list(GtkTreeView* tree) {
    GtkTreeStore* store = GTK_TREE_STORE(gtk_tree_view_get_model(tree));
    gtk_tree_store_clear(store);
    
    inspect_tex_vec_t textures = inspector->textures;
    for (inspect_texture_t* tex = textures->data; !vec_end(textures, tex); tex++) {
        char str[64];
        memset(str, 0, 64);
        snprintf(str, 64, "%u", tex->fake);
        
        GtkTreeIter row;
        gtk_tree_store_append(store, &row, NULL);
        gtk_tree_store_set(store, &row, 0, str, -1);
    }
}
开发者ID:pendingchaos,项目名称:WIP15,代码行数:15,代码来源:texture.c

示例13: contact_list_store_remove_contact

static void
contact_list_store_remove_contact (EmpathyContactListStore *store,
				   EmpathyContact          *contact)
{
	EmpathyContactListStorePriv *priv;
	GtkTreeModel               *model;
	GList                      *iters, *l;

	priv = GET_PRIV (store);

	iters = contact_list_store_find_contact (store, contact);
	if (!iters) {
		return;
	}
	
	/* Clean up model */
	model = GTK_TREE_MODEL (store);

	for (l = iters; l; l = l->next) {
		GtkTreeIter parent;

		/* NOTE: it is only <= 2 here because we have
		 * separators after the group name, otherwise it
		 * should be 1.
		 */
		if (gtk_tree_model_iter_parent (model, &parent, l->data) &&
		    gtk_tree_model_iter_n_children (model, &parent) <= 2) {
			gtk_tree_store_remove (GTK_TREE_STORE (store), &parent);
		} else {
			gtk_tree_store_remove (GTK_TREE_STORE (store), l->data);
		}
	}

	g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
	g_list_free (iters);
}
开发者ID:zenios,项目名称:empathy,代码行数:36,代码来源:empathy-contact-list-store.c

示例14: ctree_populate

static void ctree_populate(GtkWidget *widget)
{
	GtkTreeView *view = GTK_TREE_VIEW(widget);
	GtkTreeModel *model = gtk_tree_view_get_model(view);
	GtkTreeStore *store = GTK_TREE_STORE(model);
	gint i, j;
	GNode *tree;
	uint16_t handle;

	// Parse VAT
	vat_parse(&tree);

	// Retrieve breakpoint
	if(ti68k_bkpt_get_pgmentry(0, &handle))
		handle = -1;

	// and show it
	for (i = 0; i < (int)g_node_n_children(tree); i++) 
	{
		GNode *fol_node = g_node_nth_child(tree, i);
		VatSymEntry *vse = (VatSymEntry *)fol_node->data;
		GtkTreeIter fol_iter;

		gtk_tree_store_append(store, &fol_iter, NULL);
		gtk_tree_store_set(store, &fol_iter, 
			COL_NAME, vse->name, COL_HANDLE, vse->handle, 
			COL_CHECK, FALSE, COL_VISIBLE, FALSE,
			-1);

		for(j = 0; j < (int)g_node_n_children(fol_node); j++)
		{
			GNode *var_node = g_node_nth_child(fol_node, j);
			VatSymEntry *vse = (VatSymEntry *)var_node->data;
			GtkTreeIter var_iter;

			gtk_tree_store_append(store, &var_iter, &fol_iter);
			gtk_tree_store_set(store, &var_iter, 
				COL_NAME, vse->name, COL_HANDLE, vse->handle, 
				COL_CHECK, (vse->handle == handle), COL_VISIBLE, TRUE,
				-1);
		}
	}

	gtk_tree_view_expand_all(view);

	// Free copy of VAT
	vat_free(&tree);
}
开发者ID:debrouxl,项目名称:tiemu,代码行数:48,代码来源:dbg_entry.c

示例15: gsb_reconcile_config_update_line

/**
 * callback called when something change in the entries of the configuration of the reconcile
 *
 * \param tree_view
 *
 * \return FALSE
 * */
gboolean gsb_reconcile_config_update_line ( GtkWidget *entry,
					    GtkWidget *tree_view )
{
    GtkTreeIter iter;
    GtkTreeModel *model;
    GtkTreeSelection *selection;
    gboolean good;

    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
    good = gtk_tree_selection_get_selected (selection, &model, &iter);

    if (good)
    {
	gint reconcile_number;

	gtk_tree_model_get (model, &iter,
			    RECONCILIATION_RECONCILE_COLUMN, &reconcile_number,
			    -1 );

	if (reconcile_number)
	{
	    /* we are on a reconcile, change the line with the new values */
		gchar *init_date, *final_date;
		gchar *init_balance, *final_balance;

		init_date = gsb_format_gdate (gsb_data_reconcile_get_init_date (reconcile_number));
		final_date = gsb_format_gdate (gsb_data_reconcile_get_final_date (reconcile_number));
		init_balance = utils_real_get_string (gsb_data_reconcile_get_init_balance (reconcile_number));
		final_balance = utils_real_get_string (gsb_data_reconcile_get_final_balance (reconcile_number));

		gtk_tree_store_set ( GTK_TREE_STORE (model),
				     &iter,
				     RECONCILIATION_NAME_COLUMN, gsb_data_reconcile_get_name (reconcile_number),
				     RECONCILIATION_INIT_DATE_COLUMN, init_date,
				     RECONCILIATION_FINAL_DATE_COLUMN, final_date,
				     RECONCILIATION_INIT_BALANCE_COLUMN, init_balance,
				     RECONCILIATION_FINAL_BALANCE_COLUMN, final_balance,
				     -1 );
		g_free (init_date);
		g_free (final_date);
		g_free (init_balance);
		g_free (final_balance);

	}
    }

    return FALSE;
}
开发者ID:grisbi,项目名称:grisbi,代码行数:55,代码来源:gsb_reconcile_config.c


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