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


C++ gtk_tree_view_row_expanded函数代码示例

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



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

示例1: tree_buttons_replace_button

static void tree_buttons_replace_button(int button, GtkTreeIter *iter, GtkTreeStore *store)
{
	GtkTreePath *path_old, *path_new;
	GtkTreeIter tmp;
	GtkTreeSelection *sel;
	gboolean expanded;
	
	tmp = *iter;
	tree_buttons_add_button(button, iter, store);
	path_old = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &tmp);
	expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(GET_WIDGET(TREEVIEW_BUTTONS_CONFIG)), path_old);
	
	*iter = tmp;
	gtk_tree_model_iter_next(GTK_TREE_MODEL(store), iter);
	sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(GET_WIDGET(TREEVIEW_BUTTONS_CONFIG)));
	gtk_tree_selection_select_iter(sel, iter);
	
	if (expanded)
	{
		path_new = gtk_tree_model_get_path(GTK_TREE_MODEL(store), iter);
		if (gtk_tree_view_expand_row(GTK_TREE_VIEW(GET_WIDGET(TREEVIEW_BUTTONS_CONFIG)),
			path_new, FALSE) == FALSE)
		{
			fprintf(stderr, "Warning: tree_buttons_replace_button could not find newly added button.\n");
		}
		gtk_tree_path_free(path_new);
	}
	gtk_tree_path_free(path_old);
	
	gtk_tree_store_remove(store, &tmp);
}
开发者ID:0Skynet,项目名称:btnx-config,代码行数:31,代码来源:tree_buttons.c


示例2: unload_file_timeout

static gboolean
unload_file_timeout (gpointer data)
{
    struct UnloadDelayData *unload_data = data;
    GtkTreeIter iter;
    FMListModel *model;
    GtkTreePath *path;

    if (unload_data->view != NULL) {
        model = unload_data->view->model;
        if (fm_list_model_get_tree_iter_from_file (model,
                                                   unload_data->file,
                                                   unload_data->directory,
                                                   &iter)) {
            path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
            if (!gtk_tree_view_row_expanded (unload_data->view->tree,
                                             path)) {
                fm_list_model_unload_subdirectory (model, &iter);
            }
            gtk_tree_path_free (path);
        }
    }
    eel_remove_weak_pointer (&unload_data->view);

    g_free (unload_data);
    return FALSE;
}
开发者ID:ammonkey,项目名称:marlin,代码行数:27,代码来源:fm-list-view.c


示例3: button_press_handler

static gboolean
button_press_handler(GtkWidget *widget, GdkEvent *event, gpointer data _U_)
{
	if (widget == NULL || event == NULL) {
		return FALSE;
	}

	tree_view_select(widget, (GdkEventButton *) event);

	/* GDK_2BUTTON_PRESS is a doubleclick -> expand/collapse tree row */
	if (event->type == GDK_2BUTTON_PRESS) {
		GtkTreePath      *path;

		if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
						  (gint) (((GdkEventButton *)event)->x),
						  (gint) (((GdkEventButton *)event)->y),
						  &path, NULL, NULL, NULL))
		{
			if (gtk_tree_view_row_expanded(GTK_TREE_VIEW(widget), path)) {
				gtk_tree_view_collapse_row(GTK_TREE_VIEW(widget), path);
			}	else {
				gtk_tree_view_expand_row(GTK_TREE_VIEW(widget), path, FALSE);
			}
			gtk_tree_path_free(path);
		}
	}

	return FALSE;
}
开发者ID:appneta,项目名称:wireshark,代码行数:29,代码来源:packet_win.c


示例4: row_activated_cb

static void
row_activated_cb (GtkTreeView *view, GtkTreePath *path,
                  GtkTreeViewColumn *column, CommoditiesDialog *cd)
{
    GtkTreeModel *model;
    GtkTreeIter iter;

    g_return_if_fail(view);

    model = gtk_tree_view_get_model(view);
    if (gtk_tree_model_get_iter(model, &iter, path))
    {
        if (gtk_tree_model_iter_has_child(model, &iter))
        {
            /* There are children, so it's not a commodity.
             * Just expand or collapse the row. */
            if (gtk_tree_view_row_expanded(view, path))
                gtk_tree_view_collapse_row(view, path);
            else
                gtk_tree_view_expand_row(view, path, FALSE);
        }
        else
            /* It's a commodity, so click the Edit button. */
            edit_clicked(cd);
    }
}
开发者ID:CAARNICL,项目名称:gnucash,代码行数:26,代码来源:dialog-commodities.c


示例5: gnc_payment_acct_tree_row_activated_cb

void
gnc_payment_acct_tree_row_activated_cb (GtkWidget *widget, GtkTreePath *path,
                                        GtkTreeViewColumn *column, PaymentWindow *pw)
{
    GtkTreeView *view;
    GtkTreeModel *model;
    GtkTreeIter iter;

    g_return_if_fail(widget);
    view = GTK_TREE_VIEW(widget);

    model = gtk_tree_view_get_model(view);
    if (gtk_tree_model_get_iter(model, &iter, path))
    {
        if (gtk_tree_model_iter_has_child(model, &iter))
        {
            /* There are children,
             * just expand or collapse the row. */
            if (gtk_tree_view_row_expanded(view, path))
                gtk_tree_view_collapse_row(view, path);
            else
                gtk_tree_view_expand_row(view, path, FALSE);
        }
        else if (gnc_payment_window_check_payment (pw))
            /* It's an account without any children
             * If all conditions for a valid payment are met click the Ok button. */
            gnc_payment_ok_cb(widget, pw);
    }
}
开发者ID:laguz,项目名称:gnucash,代码行数:29,代码来源:dialog-payment.c


示例6: net_selection_double_click_cb

/* Called when the user double clicks on a net in the left treeview.
 */
static void
net_selection_double_click_cb (GtkTreeView * treeview, GtkTreePath * path,
			       GtkTreeViewColumn * col, gpointer data)
{
  GtkTreeModel *model;
  GtkTreeIter iter;
  gchar *str;
  LibraryMenuType *menu;

  model = gtk_tree_view_get_model (treeview);
  if (gtk_tree_model_get_iter (model, &iter, path))
    {

      /* Expand / contract nodes with children */
      if (gtk_tree_model_iter_has_child (model, &iter))
        {
          if (gtk_tree_view_row_expanded (treeview, path))
            gtk_tree_view_collapse_row (treeview, path);
          else
            gtk_tree_view_expand_row (treeview, path, FALSE);
          return;
        }

      /* Get the current enabled string and toggle it between "" and "*"
       */
      gtk_tree_model_get (model, &iter, NET_ENABLED_COLUMN, &str, -1);
      gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
			  NET_ENABLED_COLUMN, !strcmp (str, "*") ? "" : "*",
			  -1);
      /* set/clear the flag which says the net is enabled or disabled */
      gtk_tree_model_get (model, &iter, NET_LIBRARY_COLUMN, &menu, -1);
      menu->flag = strcmp (str, "*") == 0 ? 1 : 0;
      g_free (str);
    }
}
开发者ID:thequux,项目名称:pcb,代码行数:37,代码来源:gui-netlist-window.c


示例7: contact_list_view_expander_cell_data_func

static void
contact_list_view_expander_cell_data_func (GtkTreeViewColumn     *column,
					   GtkCellRenderer       *cell,
					   GtkTreeModel          *model,
					   GtkTreeIter           *iter,
					   EmpathyContactListView *view)
{
	gboolean is_group;
	gboolean is_active;

	gtk_tree_model_get (model, iter,
			    EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
			    EMPATHY_CONTACT_LIST_STORE_COL_IS_ACTIVE, &is_active,
			    -1);

	if (gtk_tree_model_iter_has_child (model, iter)) {
		GtkTreePath *path;
		gboolean     row_expanded;

		path = gtk_tree_model_get_path (model, iter);
		row_expanded = gtk_tree_view_row_expanded (GTK_TREE_VIEW (gtk_tree_view_column_get_tree_view (column)), path);
		gtk_tree_path_free (path);

		g_object_set (cell,
			      "visible", TRUE,
			      "expander-style", row_expanded ? GTK_EXPANDER_EXPANDED : GTK_EXPANDER_COLLAPSED,
			      NULL);
	} else {
		g_object_set (cell, "visible", FALSE, NULL);
	}

	contact_list_view_cell_set_background (view, cell, is_group, is_active);
}
开发者ID:james-w,项目名称:empathy,代码行数:33,代码来源:empathy-contact-list-view.c


示例8: empathy_cell_renderer_expander_activate

static gboolean
empathy_cell_renderer_expander_activate (GtkCellRenderer      *cell,
					GdkEvent             *event,
					GtkWidget            *widget,
					const gchar          *path_string,
					const GdkRectangle   *background_area,
					const GdkRectangle   *cell_area,
					GtkCellRendererState  flags)
{
	EmpathyCellRendererExpanderPriv *priv;
	GtkTreePath                    *path;

	priv = GET_PRIV (cell);

	if (!GTK_IS_TREE_VIEW (widget) || !priv->activatable)
		return FALSE;

	path = gtk_tree_path_new_from_string (path_string);

	if (gtk_tree_path_get_depth (path) > 1) {
		gtk_tree_path_free (path);
		return TRUE;
	}

	if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), path)) {
		gtk_tree_view_collapse_row (GTK_TREE_VIEW (widget), path);
	} else {
		gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), path, FALSE);
	}

	gtk_tree_path_free (path);

	return TRUE;
}
开发者ID:Dhinihan,项目名称:empathy,代码行数:34,代码来源:empathy-cell-renderer-expander.c


示例9: gm_cell_renderer_expander_activate

static gboolean
gm_cell_renderer_expander_activate (GtkCellRenderer                    *cell,
			            G_GNUC_UNUSED GdkEvent             *event,
                                    GtkWidget                          *widget,
                                    const gchar                        *path_string,
                                    G_GNUC_UNUSED const GdkRectangle   *background_area,
                                    G_GNUC_UNUSED const GdkRectangle   *cell_area,
                                    G_GNUC_UNUSED GtkCellRendererState flags)
{
	GmCellRendererExpander     *expander;
	GmCellRendererExpanderPriv *priv;
	GtkTreePath                     *path;

	expander = (GmCellRendererExpander *) cell;
	priv = expander->priv;

	if (!GTK_IS_TREE_VIEW (widget) || !priv->activatable)
		return FALSE;

	path = gtk_tree_path_new_from_string (path_string);

	if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), path)) {
		gtk_tree_view_collapse_row (GTK_TREE_VIEW (widget), path);
	} else {
		gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), path, FALSE);
	}

	gtk_tree_path_free (path);

	return TRUE;
}
开发者ID:Klom,项目名称:ekiga,代码行数:31,代码来源:gmcellrendererexpander.c


示例10: tree_selection_collect_data_helper

static void
tree_selection_collect_data_helper(GtkTreeModel *model,
	GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
{
	collect_data_struct_t *cdata = user_data;

	/* Collect the data of the parent row */
	tree_selection_collect_data_record(model, iter, cdata, TRUE);

	/* If the row is not expanded and there are any children, collect their
	 * data as well. This is not recursive and descends only one level */

	if (
			gtk_tree_model_iter_has_child(model, iter) &&
			!gtk_tree_view_row_expanded(cdata->tv, path)
	) {
		GtkTreeIter child;
		gint i = 0;

		while (gtk_tree_model_iter_nth_child(model, &child, iter, i)) {
			tree_selection_collect_data_record(model, &child, cdata, FALSE);
			i++;
		}
	}
}
开发者ID:MrJoe,项目名称:gtk-gnutella,代码行数:25,代码来源:gtk-missing.c


示例11: vdtree_add_by_data

static void vdtree_add_by_data(ViewDir *vd, FileData *fd, GtkTreeIter *parent)
{
	GtkTreeStore *store;
	GtkTreeIter child;
	NodeData *nd;
	GdkPixbuf *pixbuf;
	NodeData *end;
	GtkTreeIter empty;

	if (!fd) return;

	if (access_file(fd->path, R_OK | X_OK))
		{
		pixbuf = vd->pf->close;
		}
	else
		{
		pixbuf = vd->pf->deny;
		}

	nd = g_new0(NodeData, 1);
	nd->fd = fd;
	nd->version = fd->version;
	nd->expanded = FALSE;
	nd->last_update = time(NULL);

	store = GTK_TREE_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(vd->view)));
	gtk_tree_store_append(store, &child, parent);
	gtk_tree_store_set(store, &child, DIR_COLUMN_POINTER, nd,
					 DIR_COLUMN_ICON, pixbuf,
					 DIR_COLUMN_NAME, nd->fd->name,
					 DIR_COLUMN_COLOR, FALSE, -1);

	/* all nodes are created with an "empty" node, so that the expander is shown
	 * this is removed when the child is populated */
	end = g_new0(NodeData, 1);
	end->fd = file_data_new_simple("");
	end->expanded = TRUE;

	gtk_tree_store_append(store, &empty, &child);
	gtk_tree_store_set(store, &empty, DIR_COLUMN_POINTER, end,
					  DIR_COLUMN_NAME, "empty", -1);

	if (parent)
		{
		NodeData *pnd;
		GtkTreePath *tpath;

		gtk_tree_model_get(GTK_TREE_MODEL(store), parent, DIR_COLUMN_POINTER, &pnd, -1);
		tpath = gtk_tree_model_get_path(GTK_TREE_MODEL(store), parent);
		if (options->tree_descend_subdirs &&
		    gtk_tree_view_row_expanded(GTK_TREE_VIEW(vd->view), tpath) &&
		    !nd->expanded)
			{
			vdtree_populate_path_by_iter(vd, &child, FALSE, vd->dir_fd);
			}
		gtk_tree_path_free(tpath);
		}
}
开发者ID:GroupO,项目名称:geeqie_zas,代码行数:59,代码来源:view_dir_tree.c


示例12: contact_list_view_drag_motion

static gboolean
contact_list_view_drag_motion (GtkWidget      *widget,
			       GdkDragContext *context,
			       gint            x,
			       gint            y,
			       guint           time)
{
	static DragMotionData *dm = NULL;
	GtkTreePath           *path;
	gboolean               is_row;
	gboolean               is_different = FALSE;
	gboolean               cleanup = TRUE;

	is_row = gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
						x,
						y,
						&path,
						NULL,
						NULL,
						NULL);

	cleanup &= (!dm);

	if (is_row) {
		cleanup &= (dm && gtk_tree_path_compare (dm->path, path) != 0);
		is_different = (!dm || (dm && gtk_tree_path_compare (dm->path, path) != 0));
	} else {
		cleanup &= FALSE;
	}

	if (!is_different && !cleanup) {
		return TRUE;
	}

	if (dm) {
		gtk_tree_path_free (dm->path);
		if (dm->timeout_id) {
			g_source_remove (dm->timeout_id);
		}

		g_free (dm);

		dm = NULL;
	}

	if (!gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), path)) {
		dm = g_new0 (DragMotionData, 1);

		dm->view = EMPATHY_CONTACT_LIST_VIEW (widget);
		dm->path = gtk_tree_path_copy (path);

		dm->timeout_id = g_timeout_add_seconds (1,
			(GSourceFunc) contact_list_view_drag_motion_cb,
			dm);
	}

	return TRUE;
}
开发者ID:gcorvala,项目名称:gsoc2008,代码行数:58,代码来源:empathy-contact-list-view.c


示例13: cv_tree_activated_cb

static void 	/* row-activated, when a row is double clicked */
cv_tree_activated_cb (GtkTreeView *view, GtkTreePath *path,
							 GtkTreeViewColumn *column, gpointer data)
{
	if (gtk_tree_view_row_expanded (view, path))
		gtk_tree_view_collapse_row (view, path);
	else
		gtk_tree_view_expand_row (view, path, FALSE);
}
开发者ID:Babl0lka,项目名称:XChat,代码行数:9,代码来源:chanview-tree.c


示例14: on_dir_tree_view_key_press

gboolean on_dir_tree_view_key_press( GtkWidget* view,
                                     GdkEventKey* evt,
                                     gpointer user_data )
{
    switch(evt->keyval) {
    case GDK_Left:
    case GDK_Right:
        break;
    default:
        return FALSE;
    }


    GtkTreeSelection *select = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
    GtkTreeModel *model;
    GtkTreeIter iter;
    if(!gtk_tree_selection_get_selected(select, &model, &iter))
        return FALSE;

    GtkTreePath *path = gtk_tree_model_get_path(model, &iter);

    switch( evt->keyval ) {
    case GDK_Left:
        if(gtk_tree_view_row_expanded(GTK_TREE_VIEW(view), path)) {
            gtk_tree_view_collapse_row(GTK_TREE_VIEW(view), path);
        } else if(gtk_tree_path_up(path)) {
            gtk_tree_selection_select_path(select, path);
            gtk_tree_view_set_cursor(GTK_TREE_VIEW(view), path, NULL, FALSE);
        } else {
            return FALSE;
        }
        break;
    case GDK_Right:
        if(!gtk_tree_view_row_expanded(GTK_TREE_VIEW(view), path)) {
            gtk_tree_view_expand_row(GTK_TREE_VIEW(view), path, FALSE);
        } else {
            gtk_tree_path_down(path);
            gtk_tree_selection_select_path(select, path);
            gtk_tree_view_set_cursor(GTK_TREE_VIEW(view), path, NULL, FALSE);
        }
        break;
    }
    return TRUE;
}
开发者ID:ib,项目名称:pcmanfm,代码行数:44,代码来源:ptk-dir-tree-view.c


示例15: vdtree_press_cb

gboolean vdtree_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
{
	ViewDir *vd = data;
	GtkTreePath *tpath;
	GtkTreeViewColumn *column;
	GtkTreeIter iter;
	NodeData *nd = NULL;

	if (gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget), bevent->x, bevent->y,
					  &tpath, &column, NULL, NULL))
		{
		GtkTreeModel *store;
		gint left_of_expander;

		store = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
		gtk_tree_model_get_iter(store, &iter, tpath);
		gtk_tree_model_get(store, &iter, DIR_COLUMN_POINTER, &nd, -1);
		gtk_tree_view_set_cursor(GTK_TREE_VIEW(widget), tpath, NULL, FALSE);

		if (vdtree_clicked_on_expander(GTK_TREE_VIEW(widget), tpath, column, bevent->x, bevent->y, &left_of_expander))
			{
			vd->click_fd = NULL;

			/* clicking this region should automatically reveal an expander, if necessary
			 * treeview bug: the expander will not expand until a button_motion_event highlights it.
			 */
			if (bevent->button == MOUSE_BUTTON_LEFT &&
			    !left_of_expander &&
			    !gtk_tree_view_row_expanded(GTK_TREE_VIEW(vd->view), tpath))
				{
				vdtree_populate_path_by_iter(vd, &iter, FALSE, vd->dir_fd);
				vdtree_icon_set_by_iter(vd, &iter, vd->pf->open);
				}

			gtk_tree_path_free(tpath);
			return FALSE;
			}

		gtk_tree_path_free(tpath);
		}

	vd->click_fd = (nd) ? nd->fd : NULL;
	vd_color_set(vd, vd->click_fd, TRUE);

	if (bevent->button == MOUSE_BUTTON_RIGHT)
		{
		vd->popup = vd_pop_menu(vd, vd->click_fd);
		gtk_menu_popup(GTK_MENU(vd->popup), NULL, NULL, NULL, NULL,
			       bevent->button, bevent->time);
		}

	return (bevent->button != MOUSE_BUTTON_LEFT);
}
开发者ID:GroupO,项目名称:geeqie_zas,代码行数:53,代码来源:view_dir_tree.c


示例16: gossip_cell_renderer_expander_activate

static gboolean
gossip_cell_renderer_expander_activate (GtkCellRenderer      *cell,
					GdkEvent             *event,
					GtkWidget            *widget,
					const gchar          *path_string,
					const GdkRectangle   *background_area,
					const GdkRectangle   *cell_area,
					GtkCellRendererState  flags)
{
	GossipCellRendererExpanderPriv *priv;
	GtkTreePath                    *path;
	gboolean                        in_cell;
	int                             mouse_x;
	int                             mouse_y;

	priv = GET_PRIV (cell);

	if (!GTK_IS_TREE_VIEW (widget) || !priv->activatable)
		return FALSE;

	path = gtk_tree_path_new_from_string (path_string);

	gtk_widget_get_pointer (widget, &mouse_x, &mouse_y);
	gtk_tree_view_convert_widget_to_bin_window_coords (GTK_TREE_VIEW (widget),
							   mouse_x, mouse_y,
							   &mouse_x, &mouse_y);

	/* check if click is within the cell */
	if (mouse_x - cell_area->x >= 0
	    && mouse_x - cell_area->x <= cell_area->width) {
		in_cell = TRUE;
	} else {
		in_cell = FALSE;
	}

	if (! in_cell) {
		gtk_tree_path_free (path);
		return FALSE;
	}

	if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), path)) {
		gtk_tree_view_collapse_row (GTK_TREE_VIEW (widget), path);
		priv->style_flags &= ~(GTK_STATE_FLAG_ACTIVE);
	} else {
		gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), path, FALSE);
		priv->style_flags |= ~(GTK_STATE_FLAG_ACTIVE);
	}

	gtk_tree_path_free (path);

	return TRUE;
}
开发者ID:wangd,项目名称:rhythmbox,代码行数:52,代码来源:gossip-cell-renderer-expander.c


示例17: gm_cell_renderer_expander_activate

static gboolean
gm_cell_renderer_expander_activate (GtkCellRenderer      *cell,
                                    G_GNUC_UNUSED GdkEvent             *event,
                                    GtkWidget            *widget,
                                    const gchar          *path_string,
                                    GdkRectangle         *background_area,
                                    G_GNUC_UNUSED GdkRectangle         *cell_area,
                                    G_GNUC_UNUSED GtkCellRendererState  flags)
{
  GmCellRendererExpander     *expander;
  GmCellRendererExpanderPriv *priv;
  GtkTreePath                    *path;
  gboolean                        animate;
  gboolean                        expanding;

  expander = GM_CELL_RENDERER_EXPANDER (cell);
  priv = GET_PRIV (cell);

  if (!GTK_IS_TREE_VIEW (widget) || !priv->activatable)
    return FALSE;

  path = gtk_tree_path_new_from_string (path_string);

  if (gtk_tree_path_get_depth (path) > 2) {
    gtk_tree_path_free (path);
    return TRUE;
  }

  g_object_get (gtk_widget_get_settings (GTK_WIDGET (widget)),
                "gtk-enable-animations", &animate,
                NULL);

  if (gtk_tree_view_row_expanded (GTK_TREE_VIEW (widget), path)) {
    gtk_tree_view_collapse_row (GTK_TREE_VIEW (widget), path);
    expanding = FALSE;
  } else {
    gtk_tree_view_expand_row (GTK_TREE_VIEW (widget), path, FALSE);
    expanding = TRUE;
  }

  if (animate) {
    gm_cell_renderer_expander_start_animation (expander,
                                               GTK_TREE_VIEW (widget),
                                               path,
                                               expanding,
                                               background_area);
  }

  gtk_tree_path_free (path);

  return TRUE;
}
开发者ID:Pobegunchik,项目名称:ekiga,代码行数:52,代码来源:gmcellrendererexpander.c


示例18: bar_keyword_tree_collapse_if_unset_cb

gboolean bar_keyword_tree_collapse_if_unset_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
{
	PaneKeywordsData *pkd = data;
	gboolean set;

	gtk_tree_model_get(model, iter, FILTER_KEYWORD_COLUMN_TOGGLE, &set, -1);

	if (!set && gtk_tree_view_row_expanded(GTK_TREE_VIEW(pkd->keyword_treeview), path))
		{
		gtk_tree_view_collapse_row(GTK_TREE_VIEW(pkd->keyword_treeview), path);
		}
	return FALSE;
}
开发者ID:XelaRellum,项目名称:geeqie,代码行数:13,代码来源:bar_keywords.c


示例19: file_view_row_activated

static void
file_view_row_activated (GtkTreeView* widget, GtkTreePath* sort_path,
						 GtkTreeViewColumn* column)
{
	AnjutaFileView* view = ANJUTA_FILE_VIEW (widget);
	AnjutaFileViewPrivate* priv = ANJUTA_FILE_VIEW_GET_PRIVATE (view);
	GtkTreeIter selected;
	GtkTreePath* path = NULL;
	gboolean is_dir;
	GFile* file;
	
	GtkTreeIter select_iter;
	GtkTreeModel* sort_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
	gtk_tree_model_get_iter (sort_model, &selected, sort_path);
	gtk_tree_model_sort_convert_iter_to_child_iter(GTK_TREE_MODEL_SORT(sort_model),
												   &select_iter, &selected);
	gtk_tree_model_get (GTK_TREE_MODEL(priv->model), &select_iter,
						COLUMN_IS_DIR, &is_dir,
						-1);
	file = file_model_get_file (priv->model, &select_iter);
	
	path = gtk_tree_model_get_path(sort_model, &selected);
		
	if (is_dir)
	{
		if (!gtk_tree_view_row_expanded (GTK_TREE_VIEW (view),
										 path))
		{
			gtk_tree_view_expand_row (GTK_TREE_VIEW (view),
									  path,
									  FALSE);
		}
		else
		{
			gtk_tree_view_collapse_row (GTK_TREE_VIEW (view),
										path);
		}	
	}
	else
	{
		g_signal_emit_by_name (G_OBJECT (view),
							   "file-open",
							   file);
	}
	if (file)
		g_object_unref (file);
	if (path)
		gtk_tree_path_free(path);
}
开发者ID:rosedu,项目名称:anjuta,代码行数:49,代码来源:file-view.c


示例20: cv_tree_is_collapsed

static gboolean cv_tree_is_collapsed(chan * ch)
{
	chan *parent = cv_tree_get_parent(ch);
	GtkTreePath *path = NULL;
	gboolean ret;

	if (parent == NULL)
		return FALSE;

	path = gtk_tree_model_get_path(GTK_TREE_MODEL(parent->cv->store), &parent->iter);
	ret = !gtk_tree_view_row_expanded(((treeview *) parent->cv)->tree, path);
	gtk_tree_path_free(path);

	return ret;
}
开发者ID:kero01,项目名称:ekg,代码行数:15,代码来源:ui-gtk-chanview-tree.c



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