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

C++ GTK_TREE_MODEL_FILTER函数代码示例

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

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



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

示例1: gnc_tree_view_owner_get_selected_owner

/*
 * Retrieve the selected owner from an owner tree view.  The
 * owner tree must be in single selection mode.
 */
GncOwner *
gnc_tree_view_owner_get_selected_owner (GncTreeViewOwner *view)
{
    GtkTreeSelection *selection;
    GtkTreeModel *f_model, *s_model;
    GtkTreeIter iter, f_iter, s_iter;
    GncOwner *owner;
    GtkSelectionMode mode;

    ENTER("view %p", view);
    g_return_val_if_fail (GNC_IS_TREE_VIEW_OWNER (view), NULL);

    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(view));
    mode = gtk_tree_selection_get_mode(selection);
    if ((mode != GTK_SELECTION_SINGLE) && (mode != GTK_SELECTION_BROWSE))
    {
        return NULL;
    }
    if (!gtk_tree_selection_get_selected (selection, &s_model, &s_iter))
    {
        LEAVE("no owner, get_selected failed");
        return FALSE;
    }

    gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model),
            &f_iter, &s_iter);

    f_model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(s_model));
    gtk_tree_model_filter_convert_iter_to_child_iter (
        GTK_TREE_MODEL_FILTER (f_model), &iter, &f_iter);

    owner = iter.user_data;
    LEAVE("owner %p (%s)", owner, gncOwnerGetName (owner));
    return owner;
}
开发者ID:nishmu,项目名称:gnucash,代码行数:39,代码来源:gnc-tree-view-owner.c


示例2: privileges_table_save

void
privileges_table_save (OobsUser *user)
{
	GtkWidget *table;
	GtkTreeModel *model, *child_model;
	GtkTreeIter iter;
	OobsGroup *group;
	gboolean valid, member;

	table = gst_dialog_get_widget (tool->main_dialog, "user_privileges");
	model = gtk_tree_view_get_model (GTK_TREE_VIEW (table));
	child_model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
	valid = gtk_tree_model_get_iter_first (child_model, &iter);

	while (valid) {
		gtk_tree_model_get (child_model, &iter,
				    COL_GROUP, &group,
				    COL_MEMBER, &member,
				    -1);
		if (member)
			oobs_group_add_user (group, user);
		else
			oobs_group_remove_user (group, user);

		valid = gtk_tree_model_iter_next (child_model, &iter);
	}
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:27,代码来源:privileges-table.c


示例3: privileges_table_set_from_profile

void
privileges_table_set_from_profile (GstUserProfile *profile)
{
	GtkWidget *table;
	GtkTreeModel *model, *child_model;
	GtkTreeIter iter;
	gboolean valid;
	OobsGroup *group;

	table = gst_dialog_get_widget (tool->main_dialog, "user_privileges");
	model = gtk_tree_view_get_model (GTK_TREE_VIEW (table));
	child_model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
	valid = gtk_tree_model_get_iter_first (child_model, &iter);

	while (valid) {
		gtk_tree_model_get (child_model, &iter,
				    COL_GROUP, &group,
				    -1);

		gtk_list_store_set (GTK_LIST_STORE (child_model), &iter,
				    COL_MEMBER, find_group_in_profile (group, profile),
				    -1);

		valid = gtk_tree_model_iter_next (child_model, &iter);
	}
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:26,代码来源:privileges-table.c


示例4: privileges_table_set_from_user

void
privileges_table_set_from_user (OobsUser *user)
{
	GtkWidget *table;
	GtkTreeModel *model, *child_model;
	GtkTreeIter iter;
	gboolean valid;
	OobsGroup *group;
	GList *users;

	table = gst_dialog_get_widget (tool->main_dialog, "user_privileges");
	model = gtk_tree_view_get_model (GTK_TREE_VIEW (table));
	child_model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
	valid = gtk_tree_model_get_iter_first (child_model, &iter);

	while (valid) {
		gtk_tree_model_get (child_model, &iter,
				    COL_GROUP, &group,
				    -1);

		users = oobs_group_get_users (group);
		gtk_list_store_set (GTK_LIST_STORE (child_model), &iter,
				    COL_MEMBER, (g_list_find (users, user) != NULL),
				    -1);
		g_list_free (users);
		valid = gtk_tree_model_iter_next (child_model, &iter);
	}
}
开发者ID:guadalinex-archive,项目名称:guadalinex-v5,代码行数:28,代码来源:privileges-table.c


示例5: get_selected_owners_helper

/*
 * This helper function is called once for each row in the tree view
 * that is currently selected.  Its task is to append the corresponding
 * owner to the end of a glist.
 */
static void
get_selected_owners_helper (GtkTreeModel *s_model,
                            GtkTreePath *s_path,
                            GtkTreeIter *s_iter,
                            gpointer data)
{
    GncTreeViewSelectionInfo *gtvsi = data;
    GtkTreeModel *f_model;
    GtkTreeIter iter, f_iter;
    GncOwner *owner;

    gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (s_model),
            &f_iter, s_iter);

    f_model = gtk_tree_model_sort_get_model(GTK_TREE_MODEL_SORT(s_model));
    gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER (f_model),
            &iter, &f_iter);
    owner = iter.user_data;

    /* Only selected if it passes the filter */
    if (gtvsi->priv->filter_fn == NULL || gtvsi->priv->filter_fn(owner, gtvsi->priv->filter_data))
    {
        gtvsi->return_list = g_list_append(gtvsi->return_list, owner);
    }
}
开发者ID:nishmu,项目名称:gnucash,代码行数:30,代码来源:gnc-tree-view-owner.c


示例6: xkb_layout_filter_changed

static void
xkb_layout_filter_changed (GtkBuilder * chooser_dialog)
{
	GtkTreeModelFilter *filtered_model =
	    GTK_TREE_MODEL_FILTER (gtk_builder_get_object (chooser_dialog,
							   "filtered_layout_list_model"));
	GtkWidget *xkb_layout_filter = CWID ("xkb_layout_filter");
	const gchar *pattern =
	    gtk_entry_get_text (GTK_ENTRY (xkb_layout_filter));
	gchar *upattern = g_utf8_strup (pattern, -1);

	if (!g_strcmp0 (pattern, "")) {
		g_object_set (G_OBJECT (xkb_layout_filter),
			      "secondary-icon-name", "edit-find-symbolic",
			      "secondary-icon-activatable", FALSE,
			      "secondary-icon-sensitive", FALSE, NULL);
	} else {
		g_object_set (G_OBJECT (xkb_layout_filter),
			      "secondary-icon-name", "edit-clear-symbolic",
			      "secondary-icon-activatable", TRUE,
			      "secondary-icon-sensitive", TRUE, NULL);
	}

	if (search_pattern_list != NULL)
		g_strfreev (search_pattern_list);

	search_pattern_list = g_strsplit (upattern, " ", -1);
	g_free (upattern);

	gtk_tree_model_filter_refilter (filtered_model);
}
开发者ID:MM294,项目名称:gnome-control-center,代码行数:31,代码来源:gnome-region-panel-xkbltadd.c


示例7: hide_delete_changed_cb

static void
hide_delete_changed_cb (GtkToggleButton *widget, GUI *appGUI)
{
	config.hide_completed = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (appGUI->opt->ct_hide_items_checkbutton));
	gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (appGUI->tsk->tasks_filter));
	config.delete_completed = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (appGUI->opt->ct_delete_items_checkbutton));
}
开发者ID:rosedu,项目名称:osmo,代码行数:7,代码来源:tasks_preferences_gui.c


示例8: gnac_properties_reset_properties

static void
gnac_properties_reset_properties(void)
{
  gnac_properties_reset_basic_tab();
  gnac_properties_reset_properties_tab();
  gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(properties_filter));
}
开发者ID:GNOME,项目名称:gnac,代码行数:7,代码来源:gnac-properties.c


示例9: simple_filter_search_activate_handler

static gboolean
simple_filter_search_activate_handler(GtkEntry *entry,
				    PraghaFilterDialog *fdialog)
{

	const gchar *text = NULL;
	gchar *u_str = NULL;
	gboolean has_text;

	has_text = gtk_entry_get_text_length (GTK_ENTRY(entry)) > 0;

	if (fdialog->filter_string != NULL) {
		g_free (fdialog->filter_string);
		fdialog->filter_string = NULL;
	}

	if (has_text) {
		text = gtk_entry_get_text (entry);
		u_str = g_utf8_strdown (text, -1);
		fdialog->filter_string = u_str;
	}

	gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER(fdialog->filter_model));

	return FALSE;
}
开发者ID:mvdkwast,项目名称:pragha,代码行数:26,代码来源:pragha-filter-dialog.c


示例10: cm_delete_all_cookies_real

static void cm_delete_all_cookies_real(CookieManagerPage *cmp)
{
    CookieManagerPagePrivate *priv = cmp->priv;
    GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(priv->treeview));
    GtkTreeIter iter, iter_store, child;
    GtkTreePath *path_first, *path;

    path_first = gtk_tree_path_new_first();
    while (gtk_tree_model_get_iter(model, &iter, path_first))
    {
        path = gtk_tree_model_get_path(model, &iter);
        while (gtk_tree_model_iter_children(model, &child, &iter))
        {
            cm_delete_cookie(cmp, model, &child);
            cm_store_remove(cmp, &child);
            /* we retrieve again the iter at path because it got invalid by the delete operation */
            gtk_tree_model_get_iter(model, &iter, path);
        }
        gtk_tree_path_free(path);
        /* remove/hide the parent */
        gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(priv->filter),
                &iter_store, &iter);
        if (gtk_tree_model_iter_has_child(GTK_TREE_MODEL(priv->store), &iter_store))
            gtk_tree_store_set(priv->store, &iter_store, COOKIE_MANAGER_COL_VISIBLE, FALSE, -1);
        else
            cm_store_remove(cmp, &iter);
    }
    /* now that we deleted all matching cookies, we reset the filter */
    gtk_entry_set_text(GTK_ENTRY(priv->filter_entry), "");
    cm_set_button_sensitiveness(cmp, FALSE);

    cm_select_path(cmp, model, path_first);
    gtk_tree_path_free(path_first);
}
开发者ID:sinoory,项目名称:webv8,代码行数:34,代码来源:cookie-manager-page.c


示例11: simple_filter_search_activate_handler

static gboolean
simple_filter_search_activate_handler(GtkEntry *entry,
				    PraghaFilterDialog *fdialog)
{

	gchar *text = NULL;
	gchar *u_str = NULL;
	gboolean has_text;

	has_text = gtk_entry_get_text_length (GTK_ENTRY(entry)) > 0;

	if (fdialog->filter_string != NULL) {
		g_free (fdialog->filter_string);
		fdialog->filter_string = NULL;
	}

	if (has_text) {
		text = gtk_editable_get_chars (GTK_EDITABLE(entry), 0, -1);
		u_str = g_utf8_strdown (text, -1);
		fdialog->filter_string = u_str;
	}

	gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER(fdialog->filter_model));

	gtk_entry_set_icon_sensitive (GTK_ENTRY(entry),
				GTK_ENTRY_ICON_SECONDARY,
				has_text);

	g_free (text);

	return FALSE;
}
开发者ID:pingax,项目名称:pragha,代码行数:32,代码来源:pragha-filter-dialog.c


示例12: on_dir_tree_view_row_collapsed

void on_dir_tree_view_row_collapsed( GtkTreeView *treeview,
                                     GtkTreeIter *iter,
                                     GtkTreePath *path,
                                     gpointer user_data )
{
    GtkTreeIter real_it;
    GtkTreePath* real_path;
    GtkTreeModel* filter = gtk_tree_view_get_model( treeview );
    PtkDirTree* tree = PTK_DIR_TREE( user_data );
    gtk_tree_model_filter_convert_iter_to_child_iter(
        GTK_TREE_MODEL_FILTER( filter ), &real_it, iter );
    real_path = gtk_tree_model_filter_convert_path_to_child_path(
                    GTK_TREE_MODEL_FILTER( filter ), path );
    ptk_dir_tree_collapse_row( tree, &real_it, real_path );
    gtk_tree_path_free( real_path );
}
开发者ID:IgnorantGuru,项目名称:spacefm,代码行数:16,代码来源:ptk-dir-tree-view.c


示例13: search_entry_changed_cb

static void
search_entry_changed_cb (GtkEntry           *entry,
                         GnomeControlCenter *center)
{
  GnomeControlCenterPrivate *priv = center->priv;
  char *str;

  /* if the entry text was set manually (not by the user) */
  if (!g_strcmp0 (priv->filter_string, gtk_entry_get_text (entry)))
    return;

  /* Don't re-filter for added trailing or leading spaces */
  str = g_strdup (gtk_entry_get_text (entry));
  g_strstrip (str);
  if (!g_strcmp0 (str, priv->filter_string))
    {
      g_free (str);
      return;
    }

  g_free (priv->filter_string);
  priv->filter_string = str;

  if (!g_strcmp0 (priv->filter_string, ""))
    {
      shell_show_overview_page (center);
    }
  else
    {
      gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (priv->search_filter));
      notebook_select_page (priv->notebook, priv->search_scrolled);
    }
}
开发者ID:tigersoldier,项目名称:gnome-control-center,代码行数:33,代码来源:gnome-control-center.c


示例14: feed_list_view_select

void
feed_list_view_select (nodePtr node)
{
	GtkTreeModel *model = gtk_tree_view_get_model (flv->treeview);

	if (model && node && node != feedlist_get_root ()) {
		GtkTreePath *path;

		/* in filtered mode we need to convert the iterator */
		if (flv->feedlist_reduced_unread) {
			GtkTreeIter iter;
			gtk_tree_model_filter_convert_child_iter_to_iter (GTK_TREE_MODEL_FILTER (flv->filter), &iter, feed_list_view_to_iter (node->id));
			path = gtk_tree_model_get_path (model, &iter);
		} else {
			path = gtk_tree_model_get_path (model, feed_list_view_to_iter (node->id));
		}

		if (node->parent)
			feed_list_view_expand (node->parent);

		if (path) {
			gtk_tree_view_scroll_to_cell (flv->treeview, path, NULL, FALSE, 0.0, 0.0);
			gtk_tree_view_set_cursor (flv->treeview, path, NULL, FALSE);
			gtk_tree_path_free (path);
		}
 	} else {
		GtkTreeSelection *selection = gtk_tree_view_get_selection (flv->treeview);
		gtk_tree_selection_unselect_all (selection);
	}
}
开发者ID:lwindolf,项目名称:liferea,代码行数:30,代码来源:feed_list_view.c


示例15: feed_list_view_selection_changed_cb

static void
feed_list_view_selection_changed_cb (GtkTreeSelection *selection, gpointer data)
{
	GtkTreeIter		iter;
	GtkTreeModel	*model;
	nodePtr			node;

	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
	 	gtk_tree_model_get (model, &iter, FS_PTR, &node, -1);

		debug1 (DEBUG_GUI, "feed list selection changed to \"%s\"", node_get_title (node));

		/* 1.) update feed list and item list states */
		g_signal_emit_by_name (FEED_LIST_VIEW (flv), "selection-changed", node->id);

		/* 2.) Refilter the GtkTreeView to get rid of nodes with 0 unread
		   messages when in reduced mode. */
		gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (flv->filter));

		if (node) {
			gboolean allowModify = (NODE_SOURCE_TYPE (node->source->root)->capabilities & NODE_SOURCE_CAPABILITY_WRITABLE_FEEDLIST);
			liferea_shell_update_update_menu ((NODE_TYPE (node)->capabilities & NODE_CAPABILITY_UPDATE) ||
			                                  (NODE_TYPE (node)->capabilities & NODE_CAPABILITY_UPDATE_CHILDS));
			liferea_shell_update_feed_menu (allowModify, TRUE, allowModify);
		} else {
			liferea_shell_update_feed_menu (TRUE, FALSE, FALSE);
		}
	} else {
		/* If we cannot get the new selection we keep the old one
		   this happens when we're doing drag&drop for example. */
	}
}
开发者ID:lwindolf,项目名称:liferea,代码行数:32,代码来源:feed_list_view.c


示例16: imageheader_entry_changed_cb

static void
imageheader_entry_changed_cb( GtkEditable *editable, 
	Imageheader *imageheader )
{
	gtk_tree_model_filter_refilter( 
		GTK_TREE_MODEL_FILTER( imageheader->filter ) );
}
开发者ID:DINKIN,项目名称:nip2,代码行数:7,代码来源:imageheader.c


示例17: numeric_only

/* Returns true iff the variable selected by SOURCE is numeric */
gboolean
numeric_only (GtkWidget *source, GtkWidget *dest)
{
  gboolean retval = TRUE;

  GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (source));

  PsppireDict *dict;
  GtkTreeSelection *selection;
  GList *list, *l;

  while (GTK_IS_TREE_MODEL_FILTER (model))
    {
      model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model));
    }

  dict = PSPPIRE_DICT (model);

  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (source));

  list = gtk_tree_selection_get_selected_rows (selection, &model);

  /* Iterate through the selection of the source treeview */
  for (l = list; l ; l = l->next)
    {
      GtkTreePath *path = l->data;
      GtkTreePath *fpath = gtk_tree_model_filter_convert_path_to_child_path
	(GTK_TREE_MODEL_FILTER (model), path);

      gint *idx = gtk_tree_path_get_indices (fpath);

      const struct variable *v = psppire_dict_get_variable (dict, idx[0]);

      gtk_tree_path_free (fpath);

      if ( var_is_alpha (v))
	{
	  retval = FALSE;
	  break;
	}
    }

  g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL);
  g_list_free (list);

  return retval;
}
开发者ID:RobertDash,项目名称:pspp,代码行数:48,代码来源:dialog-common.c


示例18: remmina_main_load_files

static void remmina_main_load_files(RemminaMain *remminamain, gboolean refresh)
{
	GtkTreeModel *filter;
	GtkTreeModel *sort;
	gint n;
	gchar buf[200];
	guint context_id;

	if (refresh)
	{
		remmina_main_save_expanded_group(remminamain);
	}

	switch (remmina_pref.view_file_mode)
	{

		case REMMINA_VIEW_FILE_TREE:
			gtk_tree_view_column_set_visible(remminamain->priv->group_column, FALSE);
			remminamain->priv->file_model = GTK_TREE_MODEL(
					gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
							G_TYPE_STRING, G_TYPE_STRING));
			remmina_main_load_file_tree_group(GTK_TREE_STORE(remminamain->priv->file_model));
			n = remmina_file_manager_iterate(remmina_main_load_file_tree_callback, remminamain);
			break;

		case REMMINA_VIEW_FILE_LIST:
		default:
			gtk_tree_view_column_set_visible(remminamain->priv->group_column, TRUE);
			remminamain->priv->file_model = GTK_TREE_MODEL(
					gtk_list_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
							G_TYPE_STRING, G_TYPE_STRING));
			n = remmina_file_manager_iterate(remmina_main_load_file_list_callback, remminamain);
			break;
	}

	filter = gtk_tree_model_filter_new(remminamain->priv->file_model, NULL);
	gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(filter),
			(GtkTreeModelFilterVisibleFunc) remmina_main_filter_visible_func, remminamain, NULL);
	remminamain->priv->file_model_filter = filter;

	sort = gtk_tree_model_sort_new_with_model(filter);
	remminamain->priv->file_model_sort = sort;

	gtk_tree_view_set_model(GTK_TREE_VIEW(remminamain->priv->file_list), sort);
	gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(sort), remmina_pref.main_sort_column_id,
			remmina_pref.main_sort_order);
	g_signal_connect(G_OBJECT(sort), "sort-column-changed", G_CALLBACK(remmina_main_file_model_on_sort), remminamain);
	remmina_main_expand_group(remminamain);

	if (remminamain->priv->selected_filename)
	{
		remmina_main_select_file(remminamain, remminamain->priv->selected_filename);
	}

	g_snprintf(buf, 200, ngettext("Total %i item.", "Total %i items.", n), n);
	context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR(remminamain->priv->statusbar), "status");
	gtk_statusbar_pop(GTK_STATUSBAR(remminamain->priv->statusbar), context_id);
	gtk_statusbar_push(GTK_STATUSBAR(remminamain->priv->statusbar), context_id, buf);
}
开发者ID:BillTheBest,项目名称:Remmina,代码行数:59,代码来源:remmina_main.c


示例19: insert_source_row_into_text_view

/* Inserts the name of the selected variable into the destination widget.
   The destination widget must be a GtkTextView
 */
static void
insert_source_row_into_text_view (GtkTreeIter iter,
				  GtkWidget *dest,
				  GtkTreeModel *model,
				  gpointer data
				  )
{
  GtkTreePath *path;
  PsppireDict *dict;
  gint *idx;
  struct variable *var;
  GtkTreeIter dict_iter;
  GtkTextBuffer *buffer;

  g_return_if_fail (GTK_IS_TEXT_VIEW (dest));

  if ( GTK_IS_TREE_MODEL_FILTER (model))
    {
      dict = PSPPIRE_DICT (gtk_tree_model_filter_get_model
			   (GTK_TREE_MODEL_FILTER(model)));

      gtk_tree_model_filter_convert_iter_to_child_iter (GTK_TREE_MODEL_FILTER
							(model),
							&dict_iter, &iter);
    }
  else
    {
      dict = PSPPIRE_DICT (model);
      dict_iter = iter;
    }

  path = gtk_tree_model_get_path (GTK_TREE_MODEL (dict), &dict_iter);

  idx = gtk_tree_path_get_indices (path);

  var =  psppire_dict_get_variable (dict, *idx);

  gtk_tree_path_free (path);

  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dest));

  erase_selection (buffer);

  gtk_text_buffer_insert_at_cursor (buffer, var_get_name (var), -1);

}
开发者ID:RobertDash,项目名称:pspp,代码行数:49,代码来源:compute-dialog.c


示例20: tasks_remove_dialog_show

void
tasks_remove_dialog_show (GtkWidget *list, GtkListStore *list_store) {

GtkWidget *info_dialog, *label;
gint response;
GtkTreePath *sort_path, *filter_path, *path;
GtkTreeIter iter;

    gtk_tree_view_get_cursor (GTK_TREE_VIEW (list), &sort_path, NULL);

    if (sort_path != NULL) {

        filter_path = gtk_tree_model_sort_convert_path_to_child_path (GTK_TREE_MODEL_SORT(tasks_sort), sort_path);

        if (filter_path != NULL) {

            path = gtk_tree_model_filter_convert_path_to_child_path (GTK_TREE_MODEL_FILTER(tasks_filter), filter_path);

            if (path != NULL) {

                sprintf(tmpbuf, "%s\n\n%s", _("Selected task will be removed."), _("Are you sure ?"));

                if (config.default_stock_icons) {
                    info_dialog = gtk_message_dialog_new (GTK_WINDOW(main_window), 
                                                          GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
                                                          GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, tmpbuf);
                    gtk_window_set_title(GTK_WINDOW(info_dialog), _("Remove task"));
                } else {
                    info_dialog = gtk_dialog_new_with_buttons (_("Remove task"), GTK_WINDOW(main_window), 
                                                          GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL,
                                                          OSMO_STOCK_BUTTON_NO, GTK_RESPONSE_NO, 
                                                          OSMO_STOCK_BUTTON_YES, GTK_RESPONSE_YES, NULL);
                    gtk_window_set_default_size (GTK_WINDOW(info_dialog), 360, 150);
                    label = gtk_label_new (tmpbuf);
                    gtk_widget_show (label);
                    gtk_box_pack_start (GTK_BOX (GTK_DIALOG(info_dialog)->vbox), label, TRUE, TRUE, 0);
                }

                gtk_widget_show (info_dialog);
                response = gtk_dialog_run(GTK_DIALOG(info_dialog));
                gtk_widget_destroy(info_dialog);

                if (response == GTK_RESPONSE_YES) {   
                    gtk_tree_model_get_iter(GTK_TREE_MODEL(list_store), &iter, path);
                    gtk_list_store_remove(list_store, &iter);
                    gtk_tree_path_free(path);
                    tasks_select_first_position_in_list();
                    update_n_items();
                    g_signal_emit_by_name(G_OBJECT(calendar), "day-selected");
                }
            }

            gtk_tree_path_free(filter_path);
        }

        gtk_tree_path_free(sort_path);
    }
}
开发者ID:rosedu,项目名称:osmo,代码行数:58,代码来源:tasks_items.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_TREE_SELECTION函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_TREE_MODEL函数代码示例发布时间: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