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

C++ GTK_IS_TREE_VIEW函数代码示例

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

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



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

示例1: cell_renderer_activatable_activate

static gboolean
cell_renderer_activatable_activate (GtkCellRenderer      *cell,
                                    GdkEvent *event,
                                    GtkWidget *widget,
                                    const gchar *path_string,
                                    const GdkRectangle *background_area,
                                    const GdkRectangle *cell_area,
                                    GtkCellRendererState  flags)
{
    EmpathyCellRendererActivatable *activatable;
    gint ex, ey, bx, by, bw, bh;

    activatable = EMPATHY_CELL_RENDERER_ACTIVATABLE (cell);

    if (!GTK_IS_TREE_VIEW (widget) || event == NULL ||
            event->type != GDK_BUTTON_PRESS) {
        return FALSE;
    }

    ex  = (gint) ((GdkEventButton *) event)->x;
    ey  = (gint) ((GdkEventButton *) event)->y;
    bx = background_area->x;
    by = background_area->y;
    bw = background_area->width;
    bh = background_area->height;

    if (ex < bx || ex > (bx+bw) || ey < by || ey > (by+bh)) {
        /* Click wasn't on the icon */
        return FALSE;
    }

    g_signal_emit (activatable, signals[PATH_ACTIVATED], 0, path_string);

    return TRUE;
}
开发者ID:raluca-elena,项目名称:empathy-cheese,代码行数:35,代码来源:empathy-cell-renderer-activatable.c


示例2: gwy_grain_value_tree_view_select

/**
 * gwy_grain_value_tree_view_select:
 * @treeview: A tree view with grain values.
 * @gvalue: The grain value to select.
 *
 * Selects a particular grain value in a grain value tree view.
 *
 * If the @gvalue group is currently unexpanded, it will be expanded to
 * show it, and the tree view may scroll to make it visible.
 *
 * Since: 2.8
 **/
void
gwy_grain_value_tree_view_select(GtkTreeView *treeview,
                                 GwyGrainValue *gvalue)
{
    GtkTreeSelection *selection;
    GtkTreeModel *model;
    GtkTreePath *path;
    GtkTreeIter iter;

    g_return_if_fail(GTK_IS_TREE_VIEW(treeview));
    g_return_if_fail(GWY_IS_GRAIN_VALUE(gvalue));
    g_return_if_fail(priv_quark
                     && g_object_get_qdata(G_OBJECT(treeview), priv_quark));

    model = gtk_tree_view_get_model(treeview);
    if (!find_grain_value(model, gvalue, &iter)) {
        g_warning("Grain value not in tree model.");
        return;
    }

    path = gtk_tree_model_get_path(model, &iter);
    gtk_tree_view_expand_to_path(treeview, path);
    gtk_tree_view_scroll_to_cell(treeview, path, NULL, FALSE, 0.0, 0.0);
    gtk_tree_path_free(path);

    selection = gtk_tree_view_get_selection(treeview);
    gtk_tree_selection_select_iter(selection, &iter);
}
开发者ID:cbuehler,项目名称:gwyddion,代码行数:40,代码来源:gwygrainvaluemenu.c


示例3: setup

void
setup(GtkWidget *widget)
{
    GtkWidgetProps props(widget);
    if (widget && GTK_IS_SCROLLED_WINDOW(widget) &&
        !props->scrolledWindowHacked) {
        GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(widget);
        GtkWidget *child;

        if ((child = gtk_scrolled_window_get_hscrollbar(scrolledWindow))) {
            setupConnections(child, widget);
        }
        if ((child = gtk_scrolled_window_get_vscrollbar(scrolledWindow))) {
            setupConnections(child, widget);
        }
        if ((child = gtk_bin_get_child(GTK_BIN(widget)))) {
            if (GTK_IS_TREE_VIEW(child) || GTK_IS_TEXT_VIEW(child) ||
                GTK_IS_ICON_VIEW(child)) {
                setupConnections(child, widget);
            } else if (oneOf(gTypeName(child), "ExoIconView",
                             "FMIconContainer")) {
                setupConnections(child, widget);
            }
        }
        props->scrolledWindowHacked = true;
    }
}
开发者ID:KDE,项目名称:qtcurve,代码行数:27,代码来源:scrolledwindow.cpp


示例4: on_name_field_changed

static void
on_name_field_changed (GtkEditable *editable,
		       gpointer     user_data)
{
	GtkTreeIter   iter;
	g_return_if_fail(GTK_IS_TREE_VIEW(bookmark_list_widget));
	g_return_if_fail(GTK_IS_ENTRY(name_field));

	if (!get_selection_exists())
		return;

	/* Update text displayed in list instantly. Also remember that 
	 * user has changed text so we update real bookmark later. 
	 */
	gtk_tree_selection_get_selected (bookmark_selection,
					 NULL,
					 &iter);
	
	gtk_list_store_set (bookmark_list_store, 
			    &iter, BOOKMARK_LIST_COLUMN_NAME, 
			    gtk_entry_get_text (GTK_ENTRY (name_field)),
			    -1);
	text_changed = TRUE;
	name_text_changed = TRUE;
}
开发者ID:kleopatra999,项目名称:nautilus,代码行数:25,代码来源:nautilus-bookmarks-window.c


示例5: tree_view_button_press

static gboolean
tree_view_button_press(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
  UIMCandWinVerticalGtk *vertical_cwin;
  UIMCandWinGtk *cwin;
  GtkTreePath *path;
  gboolean exist, retval = FALSE;
  gint *indicies;

  g_return_val_if_fail(GTK_IS_TREE_VIEW(widget), FALSE);
  g_return_val_if_fail(UIM_CAND_WIN_VERTICAL_GTK(data), FALSE);

  vertical_cwin = UIM_CAND_WIN_VERTICAL_GTK(data);
  cwin = UIM_CAND_WIN_GTK(vertical_cwin);

  exist = gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(widget),
					event->x, event->y,
					&path, NULL, NULL, NULL);
  if (!exist)
    return FALSE;

  indicies = gtk_tree_path_get_indices(path);

  /* don't relay button press event to empty row */
  if (cwin->display_limit * cwin->page_index + *indicies >= cwin->nr_candidates)
    retval = TRUE;

  gtk_tree_path_free(path);

  return retval;
}
开发者ID:DirtYiCE,项目名称:uim,代码行数:31,代码来源:uim-cand-win-vertical-gtk.c


示例6: qtcTreeViewLeave

static gboolean
qtcTreeViewLeave(GtkWidget *widget, GdkEventMotion *event, void *data)
{
    QTC_UNUSED(event);
    QTC_UNUSED(data);
    if (GTK_IS_TREE_VIEW(widget)) {
        QtCTreeView *tv = qtcTreeViewLookupHash(widget, false);
        if (tv) {
            GtkTreeView *treeView = GTK_TREE_VIEW(widget);
            QtcRect rect = {0, 0, -1, -1 };
            QtcRect alloc = qtcWidgetGetAllocation(widget);

            if (tv->path && tv->column) {
                gtk_tree_view_get_background_area(
                    treeView, tv->path, tv->column, (GdkRectangle*)&rect);
            }
            if (tv->fullWidth) {
                rect.x = 0;
                rect.width = alloc.width;
            }
            if (tv->path) {
                gtk_tree_path_free(tv->path);
            }
            tv->path = NULL;
            tv->column = NULL;

            gtk_tree_view_convert_bin_window_to_widget_coords(
                treeView, rect.x, rect.y, &rect.x, &rect.y);
            gtk_widget_queue_draw_area(
                widget, rect.x, rect.y, rect.width, rect.height);
        }
    }
    return false;
}
开发者ID:Kermit,项目名称:qtcurve,代码行数:34,代码来源:treeview.c


示例7: thumbnail_region

/* Get a new thumbnail region of GtkTreeView widget in which event
falls.  It is an error to call this function if !in_thumbnail
(widget, event).  */
static GdkRegion *
thumbnail_region (GtkWidget *widget, GdkEventMotion *event)
{
    g_assert (GTK_IS_TREE_VIEW (widget));

    g_assert (in_thumbnail (widget, event));

    GtkTreePath *tp = thumbnail_path (widget, event);
    g_assert (tp != NULL);

    /* Rectangle of region to be returned.  */
    GdkRectangle tn_rect;

    /* If over the input image thumbnail, return the input thumbnail region, */
    GtkTreeViewColumn *tc = NULL;	/* Thumbnail column we are over.  */
    if ( in_input_thumbnail (widget, event) ) {
        tc = input_thumbnail_column (widget, event);
    }

    gtk_tree_view_get_cell_area (GTK_TREE_VIEW (widget), tp, tc, &tn_rect);

    /* Here we depend on the fact that the thumbnails are packed at the
    beginning of the cell horizontally, and centered in the cell
    vertically (FIXME: find a way to verify this with assertions).  */
    GdkRectangle itn_rect;		/* Image thumbnail rectangle.  */
    /* FIXME: fix this border hackery to be precise somehow.  */
    itn_rect.x = tn_rect.x + 1;	/* There is probably a small border so +1.  */
    itn_rect.y = tn_rect.y + 1;
    itn_rect.width = THUMB_SIZE;
    itn_rect.height = THUMB_SIZE;

    return gdk_region_rectangle (&itn_rect);
}
开发者ID:glshort,项目名称:MapReady,代码行数:36,代码来源:blow_up_in.c


示例8: set_role_for_button

static void
set_role_for_button (AtkObject *accessible,
                     GtkWidget *button)
{
  GtkWidget *parent;
  AtkRole role;

  parent = gtk_widget_get_parent (button);
  if (GTK_IS_TREE_VIEW (parent))
    {
      role = ATK_ROLE_TABLE_COLUMN_HEADER;
      /*
       * Even though the accessible parent of the column header will
       * be reported as the table because the parent widget of the
       * GtkTreeViewColumn's button is the GtkTreeView we set
       * the accessible parent for column header to be the table
       * to ensure that atk_object_get_index_in_parent() returns
       * the correct value; see gail_widget_get_index_in_parent().
       */
      atk_object_set_parent (accessible, gtk_widget_get_accessible (parent));
    }
  else
    role = ATK_ROLE_PUSH_BUTTON;

  accessible->role =  role;
}
开发者ID:BYC,项目名称:gtk,代码行数:26,代码来源:gailbutton.c


示例9: gmpc_meta_data_widgets_similar_songs_tree_row_activated

static void gmpc_meta_data_widgets_similar_songs_tree_row_activated (GmpcMetaDataWidgetsSimilarSongs* self, GtkWidget* tree, GtkTreePath* path, GtkTreeViewColumn* column) {
	GtkWidget* _tmp0_;
	GtkTreeModel* _tmp1_ = NULL;
	GtkTreeModel* _tmp2_;
	GtkTreeModel* model;
	GtkTreeIter iter = {0};
	GtkTreeIter _tmp3_ = {0};
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (tree != NULL);
	g_return_if_fail (path != NULL);
	g_return_if_fail (column != NULL);
	_tmp0_ = tree;
	_tmp1_ = gtk_tree_view_get_model (GTK_IS_TREE_VIEW (_tmp0_) ? ((GtkTreeView*) _tmp0_) : NULL);
	_tmp2_ = _g_object_ref0 (_tmp1_);
	model = _tmp2_;
	_tmp4_ = gtk_tree_model_get_iter (model, &_tmp3_, path);
	iter = _tmp3_;
	if (_tmp4_) {
		const mpd_Song* song;
		song = NULL;
		gtk_tree_model_get (model, &iter, 0, &song, -1, -1);
		if (song != NULL) {
			play_path (song->file);
		}
	}
	_g_object_unref0 (model);
}
开发者ID:emillon,项目名称:gmpc,代码行数:28,代码来源:gmpc-metadata-similarsongs.c


示例10: bastile_gkr_item_properties_show

void
bastile_gkr_item_properties_show (BastileGkrItem *git, GtkWindow *parent)
{
    BastileObject *object = BASTILE_OBJECT (git);
    BastileWidget *swidget = NULL;
    GtkWidget *widget;

    swidget = bastile_object_widget_new ("gkr-item-properties", parent, object);
    
    /* This happens if the window is already open */
    if (swidget == NULL)
        return;

    bastile_object_refresh (object);

    widget = GTK_WIDGET (bastile_widget_get_widget (swidget, swidget->name));
    g_signal_connect (widget, "response", G_CALLBACK (properties_response), swidget);

    /* 
     * The signals don't need to keep getting connected. Everytime a key changes the
     * do_* functions get called. Therefore, seperate functions connect the signals
     * have been created
     */

    setup_main (swidget);
    setup_details (swidget);
    setup_application (swidget);
    
    widget = bastile_widget_get_widget (swidget, "application-list");
    g_return_if_fail (GTK_IS_TREE_VIEW (widget));
    
    g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), "changed", 
                      G_CALLBACK (application_selection_changed), swidget);
}
开发者ID:gfunkmonk2,项目名称:bastile,代码行数:34,代码来源:bastile-gkr-item-properties.c


示例11: 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


示例12: seahorse_key_manager_store_get_selected_object

GObject *
seahorse_key_manager_store_get_selected_object (GtkTreeView *view)
{
	SeahorseKeyManagerStore* skstore;
	GObject *obj = NULL;
	GList *paths = NULL;
	GtkTreeSelection *selection;

	g_return_val_if_fail (GTK_IS_TREE_VIEW (view), NULL);
	skstore = SEAHORSE_KEY_MANAGER_STORE (gtk_tree_view_get_model (view));
	g_return_val_if_fail (SEAHORSE_IS_KEY_MANAGER_STORE (skstore), NULL);

	selection = gtk_tree_view_get_selection (view);
	paths = gtk_tree_selection_get_selected_rows (selection, NULL);

	/* choose first object */
	if (paths != NULL) {
		obj = seahorse_key_manager_store_get_object_from_path (view, paths->data);

		/* free selected paths */
		g_list_foreach (paths, (GFunc)gtk_tree_path_free, NULL);
		g_list_free (paths);
	}

	return obj;
}
开发者ID:atulhjp,项目名称:seahorse,代码行数:26,代码来源:seahorse-key-manager-store.c


示例13: seahorse_key_manager_store_set_selected_objects

void
seahorse_key_manager_store_set_selected_objects (GtkTreeView *view, GList* objects)
{
	SeahorseKeyManagerStore* skstore;
	GtkTreeSelection* selection;
	gboolean first = TRUE;
	GtkTreePath *path;
	GList *l;
	GtkTreeIter iter;

	g_return_if_fail (GTK_IS_TREE_VIEW (view));
	selection = gtk_tree_view_get_selection (view);
	gtk_tree_selection_unselect_all (selection);

	skstore = SEAHORSE_KEY_MANAGER_STORE (gtk_tree_view_get_model (view));
	g_return_if_fail (SEAHORSE_IS_KEY_MANAGER_STORE (skstore));

	for (l = objects; l; l = g_list_next (l)) {
		if (gcr_collection_model_iter_for_object (GCR_COLLECTION_MODEL (skstore),
		                                          l->data, &iter)) {
			gtk_tree_selection_select_iter (selection, &iter);

			/* Scroll the first row selected into view */
			if (first) {
				path = gtk_tree_model_get_path (gtk_tree_view_get_model (view), &iter);
				gtk_tree_view_scroll_to_cell (view, path, NULL, FALSE, 0.0, 0.0);
				gtk_tree_path_free (path);
				first = FALSE;
			}
		}
	}
}
开发者ID:atulhjp,项目名称:seahorse,代码行数:32,代码来源:seahorse-key-manager-store.c


示例14: cact_providers_list_init_view

/**
 * cact_providers_list_init_view:
 * @window: the parent #BaseWindow which embeds the view.
 * @treeview: the #GtkTreeView.
 *
 * Connects signals at runtime initialization of the widget, and setup
 * current default values.
 */
void
cact_providers_list_init_view( BaseWindow *window, GtkTreeView *treeview )
{
	static const gchar *thisfn = "cact_providers_list_init_view";
	ProvidersListData *data;
	CactApplication *application;
	NAUpdater *updater;

	g_return_if_fail( BASE_IS_WINDOW( window ));
	g_return_if_fail( GTK_IS_TREE_VIEW( treeview ));

	g_debug( "%s: treeview=%p, window=%p", thisfn, ( void * ) treeview, ( void * ) window );

	g_object_set_data( G_OBJECT( window ), PROVIDERS_LIST_TREEVIEW, treeview );

	data = get_providers_list_data( treeview );
	data->window = window;
	application = CACT_APPLICATION( base_window_get_application( window ));
	updater = cact_application_get_updater( application );
	data->preferences_locked = na_updater_are_preferences_locked( updater );

	init_view_setup_providers( treeview, window );
	init_view_connect_signals( treeview, window );

	init_view_select_first_row( treeview );
}
开发者ID:nmbooker,项目名称:caja-actions,代码行数:34,代码来源:cact-providers-list.c


示例15: baobab_treeview_show_allocated_size

void
baobab_treeview_show_allocated_size (GtkWidget *tv,
				     gboolean show_allocated)
{
	gint sort_id;
	gint new_sort_id;
	GtkSortType order;
	GtkTreeViewColumn *size_col;

	g_return_if_fail (GTK_IS_TREE_VIEW (tv));

	gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (baobab.model),
					      &sort_id, &order);

	/* set the sort id for the size column */
	size_col = g_object_get_data (G_OBJECT (tv), "baobab_size_col");
	new_sort_id = show_allocated ? COL_H_ALLOCSIZE : COL_H_SIZE;
	gtk_tree_view_column_set_sort_column_id (size_col, new_sort_id);

	/* if we are currently sorted on size or allocated size,
	 * then trigger a resort (with the same order) */
	if (sort_id == COL_H_SIZE || sort_id == COL_H_ALLOCSIZE) {
		gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (baobab.model),
						      new_sort_id, order);
	}
}
开发者ID:5Ecur1ty,项目名称:baobab,代码行数:26,代码来源:baobab-treeview.c


示例16: rb_tree_dnd_add_drag_source_support

/**
 * rb_tree_dnd_add_drag_source_support:
 * @tree_view: a #GtkTreeView that wants to be a drag source
 * @start_button_mask: a mask describing modifier keys to handle when dragging
 * @targets: an array of #GtkTargetEntry structures describing drag data types
 * @n_targets: the number of elements in @targets
 * @actions: a mask describing drag actions that are allowed from this source
 *
 * Adds event handlers to perform multi-row drag and drop operations from the
 * specified #GtkTreeView widget.  The model backing the #GtkTreeView must
 * implement the #RbTreeDragSource interface.  This should be called immediately
 * after the tree view is created.
 */
void
rb_tree_dnd_add_drag_source_support (GtkTreeView *tree_view,
				     GdkModifierType start_button_mask,
				     const GtkTargetEntry *targets,
				     gint n_targets,
				     GdkDragAction actions)
{
	RbTreeDndData *priv_data = NULL;
 	g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));

	priv_data = init_rb_tree_dnd_data (GTK_WIDGET(tree_view));

	if (!priv_data->button_press_event_handler) {

		priv_data->source_target_list = gtk_target_list_new (targets, n_targets);
		priv_data->source_actions = actions;
		priv_data->start_button_mask = start_button_mask;

		priv_data->button_press_event_handler = g_signal_connect (G_OBJECT (tree_view),
							"button_press_event",
							G_CALLBACK (rb_tree_dnd_button_press_event_cb),
							NULL);
		priv_data->drag_data_get_handler = g_signal_connect (G_OBJECT (tree_view),
								     "drag_data_get",
								     G_CALLBACK (rb_tree_dnd_drag_data_get_cb),
								     NULL);
		priv_data->drag_data_delete_handler = g_signal_connect (G_OBJECT (tree_view),
									"drag_data_delete",
									G_CALLBACK (rb_tree_dnd_drag_data_delete_cb),
									NULL);
	}
}
开发者ID:paulbellamy,项目名称:Rhythmbox-iPod-Plugin,代码行数:45,代码来源:rb-tree-dnd.c


示例17: foldercheck_set_tree

/* Set tree of the tree-store. This includes getting the folder tree and
 * storing it */
static void foldercheck_set_tree(SpecificFolderArrayEntry *entry)
{
  Folder *folder;
  GList *list;

  for(list = folder_get_list(); list != NULL; list = list->next) {
    folder = FOLDER(list->data);

    if(folder == NULL) {
      debug_print("Notification plugin::foldercheck_set_tree(): Found a NULL folder.\n");
      continue;
    }

    /* Only regard built-in folders, because folders from plugins (such as RSS, calendar,
     * or plugin-provided mailbox storage systems like Maildir or MBox) may vanish
     * without letting us know. */
    switch(folder->klass->type) {
    case F_MH:
    case F_IMAP:
    case F_NEWS:
      foldercheck_insert_gnode_in_store(entry->tree_store, folder->node, NULL);
      break;
    default:
      break;
    }
  }

  gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(entry->tree_store),
				       FOLDERCHECK_FOLDERNAME,
				       GTK_SORT_ASCENDING);

  if(GTK_IS_TREE_VIEW(entry->treeview))
    gtk_tree_view_expand_all(GTK_TREE_VIEW(entry->treeview));
}
开发者ID:twolife,项目名称:claws,代码行数:36,代码来源:notification_foldercheck.c


示例18: gel_ui_tree_view_get_selected_indices

/**
 * gel_ui_tree_view_get_selected_indices:
 * @tv: A #GtkTreeView
 *
 * Returns a %NULL terminated array of gint with the indices of selected
 * rows, only works with a #GtkTreeView holding a #GtkListModel
 *
 * Returns: (allow-none) (transfer full): The selected indices, each index and the value
 *                           it self must be freeed with g_free
 */
gint *
gel_ui_tree_view_get_selected_indices(GtkTreeView *tv)
{
	g_return_val_if_fail(GTK_IS_TREE_VIEW(tv), NULL);
	g_return_val_if_fail(GTK_IS_LIST_STORE(gtk_tree_view_get_model(tv)), NULL);

	GtkTreeSelection *selection = gtk_tree_view_get_selection(tv);
	GtkTreeModel     *model     = gtk_tree_view_get_model(tv);

	GList *l, *iter; // iter over selected treepaths
	gint  *indices;  // hold treepath's indices
	gint i = 0;      // index
	l = iter = gtk_tree_selection_get_selected_rows(selection, &model);
	gint *ret = g_new0(gint, g_list_length(l) + 1);
	while (iter)
	{
		indices = gtk_tree_path_get_indices((GtkTreePath *) iter->data);
		if (!indices || !indices[0] || !indices[1] || (indices[1] != -1))
		{
			g_warning(_("Invalid GtkTreePath in selection, use %s only with ListModels"), __FUNCTION__);
			continue;
		}

		ret[i++] = indices[0];
		l = l->next;
	}
	g_list_foreach(l, (GFunc) gtk_tree_path_free, NULL);
	g_list_free(l);

	return ret;
}
开发者ID:ldotlopez,项目名称:eina,代码行数:41,代码来源:gel-ui-utils.c


示例19: in_input_thumbnail

static gboolean
in_input_thumbnail (GtkWidget *widget, GdkEventMotion *event)
{
    g_assert (GTK_IS_TREE_VIEW (widget));

    gboolean result = FALSE;	/* Result to be returned. */

    GtkTreePath *tp = thumbnail_path (widget, event);

    if ( tp == NULL ) {
        return FALSE;		/* Pointer is not over a filled in row.  */
    }

    /* Check if we are over the input image thumbnail.  */
    GtkTreeViewColumn *itc = input_thumbnail_column (widget, event);
    GdkRectangle itnc_rect;	/* Input thumbnail cell rectangle.  */
    gtk_tree_view_get_cell_area (GTK_TREE_VIEW (widget), tp, itc, &itnc_rect);
    /* Here we depend on the fact that the input thumbnail is packed at
    the beginning of the cell horizontally, and centered in the cell
    vertically (FIXME: find a way to verify this with assertions).  */
    GdkRectangle itn_rect;	/* Input thumbnail rectangle.  */
    /* FIXME: fix this border hackery to be precise somehow.  */
    itn_rect.x = itnc_rect.x + 1;	/* There is probably a small border so +1.  */
    itn_rect.y = itnc_rect.y + 1;
    itn_rect.width = THUMB_SIZE;
    itn_rect.height = THUMB_SIZE;
    GdkRegion *itn_region = gdk_region_rectangle (&itn_rect);
    if ( gdk_region_point_in (itn_region, (int) event->x, (int) event->y) ) {
        result = TRUE;
        //    g_message ("Over input thumbnail!");
    }
    gdk_region_destroy (itn_region);

    return result;
}
开发者ID:glshort,项目名称:MapReady,代码行数:35,代码来源:blow_up_in.c


示例20: 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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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