您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GNOME_CANVAS_ITEM函数代码示例

51自学网 2021-06-01 20:53:41
  C++
这篇教程C++ GNOME_CANVAS_ITEM函数代码示例写得很实用,希望能帮到您。

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

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

示例1: wire_changed_callback

static voidwire_changed_callback (Wire *wire, WireItem *item){	SheetPos start_pos, length;	GnomeCanvasPoints *points;	wire_get_pos_and_length (wire, &start_pos, &length);	points = gnome_canvas_points_new (2);	points->coords[0] = 0;	points->coords[1] = 0;	points->coords[2] = length.x;	points->coords[3] = length.y;	gnome_canvas_item_set (GNOME_CANVAS_ITEM (item->priv->line),		"points", points,		NULL);	gnome_canvas_points_unref (points);	gnome_canvas_item_set (GNOME_CANVAS_ITEM (item->priv->resize1),		"x1", -RESIZER_SIZE,		"y1", -RESIZER_SIZE,		"x2", RESIZER_SIZE,		"y2", RESIZER_SIZE,		NULL);	gnome_canvas_item_set (GNOME_CANVAS_ITEM (item->priv->resize2),		"x1", length.x-RESIZER_SIZE,		"y1", length.y-RESIZER_SIZE,		"x2", length.x+RESIZER_SIZE,		"y2", length.y+RESIZER_SIZE,		NULL);}
开发者ID:Miuler,项目名称:oregano,代码行数:33,


示例2: e_minicard_view_drag_begin

static ginte_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter,                            GdkEvent *event,                            EMinicardView *view){	GdkDragContext *context;	GtkTargetList *target_list;	GdkDragAction actions = GDK_ACTION_MOVE | GDK_ACTION_COPY;	clear_drag_data (view);	view->drag_list = e_minicard_view_get_card_list (view);	target_list = gtk_target_list_new (drag_types, G_N_ELEMENTS (drag_types));	context = gtk_drag_begin (		GTK_WIDGET (GNOME_CANVAS_ITEM (view)->canvas),		target_list, actions, 1/*XXX */, event);	if (!view->canvas_drag_data_get_id)		view->canvas_drag_data_get_id = g_signal_connect (			GNOME_CANVAS_ITEM (view)->canvas, "drag_data_get",			G_CALLBACK (e_minicard_view_drag_data_get), view);	gtk_drag_set_icon_default (context);	return TRUE;}
开发者ID:Distrotech,项目名称:evolution,代码行数:28,


示例3: iti_start_selecting

/* Starts the selection state in the icon text item */static voiditi_start_selecting (GnomeIconTextItem *iti, int idx, guint32 event_time){	GnomeIconTextItemPrivate *priv;	GtkEditable *e;	GdkCursor *ibeam;	priv = iti->_priv;	e = GTK_EDITABLE (priv->entry);	gtk_editable_select_region (e, idx, idx);	gtk_editable_set_position (e, idx);	ibeam = gdk_cursor_new (GDK_XTERM);	gnome_canvas_item_grab (GNOME_CANVAS_ITEM (iti),				GDK_BUTTON_RELEASE_MASK |				GDK_POINTER_MOTION_MASK,				ibeam, event_time);	gdk_cursor_unref (ibeam);	gtk_editable_select_region (e, idx, idx);	priv->selecting = TRUE;	priv->selection_start = idx;	gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (iti));	g_signal_emit (iti, iti_signals[SELECTION_STARTED], 0);}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:28,


示例4: ghack_map_cursor_to

voidghack_map_cursor_to(GtkWidget *win, int x, int y, gpointer data){    GnomeCanvasGroup *group;    static GnomeCanvasRE *cursor = NULL;    double x1, y1, x2, y2;    float hp;    guint r, g, b;    x1 = x * ghack_glyph_width() - 1;    y1 = y * ghack_glyph_height() - 1;    x2 = x1 + ghack_glyph_width() + 2;    y2 = y1 + ghack_glyph_height() + 2;    hp = u.mtimedone ? (u.mhmax ? (float) u.mh / u.mhmax : 1)         : (u.uhpmax ? (float) u.uhp / u.uhpmax : 1);    r = 255;    g = (hp >= 0.75) ? 255 : (hp >= 0.25 ? 255 * 2 * (hp - 0.25) : 0);    b = (hp >= 0.75) ? 255 * 4 * (hp - 0.75)        : (hp >= 0.25 ? 0 : 255 * 4 * (0.25 - hp));    group = gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas));    if (!cursor) {        cursor = GNOME_CANVAS_RE(gnome_canvas_item_new(                                     group, gnome_canvas_rect_get_type(), "width_units", 1.0, NULL));    }    gnome_canvas_item_set(GNOME_CANVAS_ITEM(cursor), "outline_color_rgba",                          GNOME_CANVAS_COLOR(r, g, b), "x1", x1, "y1", y1,                          "x2", x2, "y2", y2, NULL);    gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(cursor));    gnome_canvas_item_show(GNOME_CANVAS_ITEM(cursor));}
开发者ID:tung,项目名称:nethack360-statuscolors,代码行数:35,


示例5: ghack_map_print_glyph

voidghack_map_print_glyph(GtkObject *win, guint x, guint y, GdkImlibImage *im,                      gpointer data){    GnomeCanvasGroup *group;    int i = y * COLNO + x;    int glyph = glyph_at(x, y);    GnomeCanvasImage *canvas_image = GNOME_CANVAS_IMAGE(ghack_map.map[i]);    group = gnome_canvas_root(GNOME_CANVAS(ghack_map.canvas));    gnome_canvas_item_set(GNOME_CANVAS_ITEM(canvas_image), "image", im, NULL);    gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));    canvas_image = GNOME_CANVAS_IMAGE(ghack_map.overlay[i]);    if (x == u.ux && y == u.uy)        ghack_map_cliparound(NULL, x, y, NULL);    if (glyph_is_pet(glyph)#ifdef TEXTCOLOR            && iflags.hilite_pet#endif       ) {        gnome_canvas_item_raise_to_top(GNOME_CANVAS_ITEM(canvas_image));        gnome_canvas_item_show(GNOME_CANVAS_ITEM(canvas_image));    } else {        gnome_canvas_item_hide(GNOME_CANVAS_ITEM(canvas_image));    }}
开发者ID:tung,项目名称:nethack360-statuscolors,代码行数:30,


示例6: selection_changed

static voidselection_changed(WireItem *item, gboolean select, gpointer user_data){	g_object_ref(G_OBJECT(item));	if (select) {		gtk_idle_add ((gpointer) select_idle_callback, item);		gnome_canvas_item_show (GNOME_CANVAS_ITEM (item->priv->resize1));		gnome_canvas_item_show (GNOME_CANVAS_ITEM (item->priv->resize2));	} else {		gtk_idle_add ((gpointer) deselect_idle_callback, item);		gnome_canvas_item_hide (GNOME_CANVAS_ITEM (item->priv->resize1));		gnome_canvas_item_hide (GNOME_CANVAS_ITEM (item->priv->resize2));	}}
开发者ID:Miuler,项目名称:oregano,代码行数:14,


示例7: ghack_map_clear

voidghack_map_clear(GtkWidget *win, gpointer data){    int i;    for (i = 0; i < ROWNO * COLNO; i++) {        if (GNOME_IS_CANVAS_IMAGE(ghack_map.map[i])) {            gnome_canvas_item_hide(GNOME_CANVAS_ITEM(ghack_map.map[i]));        }        if (GNOME_IS_CANVAS_IMAGE(ghack_map.overlay[i])) {            gnome_canvas_item_hide(GNOME_CANVAS_ITEM(ghack_map.overlay[i]));        }    }    gnome_canvas_update_now(GNOME_CANVAS(ghack_map.canvas));}
开发者ID:tung,项目名称:nethack360-statuscolors,代码行数:15,


示例8: iti_stop_selecting

/* Stops the selection state in the icon text item */static voiditi_stop_selecting (GnomeIconTextItem *iti, guint32 event_time){	GnomeIconTextItemPrivate *priv;	GnomeCanvasItem *item;	priv = iti->_priv;	item = GNOME_CANVAS_ITEM (iti);	gnome_canvas_item_ungrab (item, event_time);	priv->selecting = FALSE;	gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (iti));	g_signal_emit (iti, iti_signals[SELECTION_STOPPED], 0);}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:16,


示例9: recompute_bounding_box

/* Recomputes the bounding box of an icon text item */static voidrecompute_bounding_box (GnomeIconTextItem *iti){	GnomeCanvasItem *item;	double x1, y1, x2, y2;	int width_c, height_c;	int width_w, height_w;	int max_width_w;	item = GNOME_CANVAS_ITEM (iti);	width_c = iti->_priv->layout_width + 2 * MARGIN_X;	height_c = iti->_priv->layout_height + 2 * MARGIN_Y;	width_w = ROUND (width_c / item->canvas->pixels_per_unit);	height_w = ROUND (height_c / item->canvas->pixels_per_unit);	max_width_w = ROUND (iti->width / item->canvas->pixels_per_unit);	x1 = iti->x;	y1 = iti->y;	gnome_canvas_item_i2w (item, &x1, &y1);	x1 += ROUND ((max_width_w - width_w) / 2);	x2 = x1 + width_w;	y2 = y1 + height_w;	gnome_canvas_w2c_d (item->canvas, x1, y1, &item->x1, &item->y1);	gnome_canvas_w2c_d (item->canvas, x2, y2, &item->x2, &item->y2);}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:31,


示例10: e_canvas_item_invoke_reflow

static voide_canvas_item_invoke_reflow (GnomeCanvasItem *item, int flags){	GnomeCanvasGroup *group;	GList *list;	GnomeCanvasItem *child;	if (GNOME_IS_CANVAS_GROUP (item)) {		group = GNOME_CANVAS_GROUP (item);		for (list = group->item_list; list; list = list->next) {			child = GNOME_CANVAS_ITEM (list->data);			if (child->object.flags & E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW)				e_canvas_item_invoke_reflow (child, flags);		}	}	if (item->object.flags & E_CANVAS_ITEM_NEEDS_REFLOW) {		ECanvasItemReflowFunc func;		func = (ECanvasItemReflowFunc)			g_object_get_data (G_OBJECT (item),					   "ECanvasItem::reflow_callback");		if (func)			func (item, flags);	}	item->object.flags &= ~E_CANVAS_ITEM_NEEDS_REFLOW;	item->object.flags &= ~E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW;}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:28,


示例11: gnc_date_cell_enter

static gbooleangnc_date_cell_enter (BasicCell *bcell,                     int *cursor_position,                     int *start_selection,                     int *end_selection){    DateCell *cell = (DateCell *) bcell;    PopBox *box = bcell->gui_private;    gnc_item_edit_set_popup (box->item_edit, GNOME_CANVAS_ITEM (box->date_picker),                             get_popup_height, NULL, popup_set_focus,                             NULL, NULL, NULL);    block_picker_signals (cell);    gnc_date_picker_set_date (box->date_picker,                              box->date.tm_mday,                              box->date.tm_mon,                              box->date.tm_year + 1900);    unblock_picker_signals (cell);    date_picker_connect_signals ((DateCell *) bcell);    *start_selection = 0;    *end_selection = -1;    return TRUE;}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:27,


示例12: e_table_group_container_construct

/** * e_table_group_container_construct * @parent: The %GnomeCanvasGroup to create a child of. * @etgc: The %ETableGroupContainer. * @full_header: The full header of the %ETable. * @header: The current header of the %ETable. * @model: The %ETableModel of the %ETable. * @sort_info: The %ETableSortInfo of the %ETable. * @n: Which grouping level this is (Starts at 0 and sends n + 1 to any child %ETableGroups. * * This routine constructs the new %ETableGroupContainer. */voide_table_group_container_construct (GnomeCanvasGroup *parent, ETableGroupContainer *etgc,				   ETableHeader *full_header,				   ETableHeader     *header,				   ETableModel *model, ETableSortInfo *sort_info, int n){	ETableCol *col;	ETableSortColumn column = e_table_sort_info_grouping_get_nth(sort_info, n);	GtkStyle *style;	col = e_table_header_get_column_by_col_idx(full_header, column.column);	if (col == NULL)		col = e_table_header_get_column (full_header, e_table_header_count (full_header) - 1);	e_table_group_construct (parent, E_TABLE_GROUP (etgc), full_header, header, model);	etgc->ecol = col;	g_object_ref (etgc->ecol);	etgc->sort_info = sort_info;	g_object_ref (etgc->sort_info);	etgc->n = n;	etgc->ascending = column.ascending;	style = GTK_WIDGET (GNOME_CANVAS_ITEM (etgc)->canvas)->style;	etgc->font_desc = pango_font_description_copy (style->font_desc);	etgc->open = TRUE;}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:39,


示例13: ea_addressbook_focus_watcher

static gbooleanea_addressbook_focus_watcher (GSignalInvocationHint *ihint,                              guint n_param_values,                              const GValue *param_values,                              gpointer data){	GObject *object;	GdkEvent *event;	AtkObject *ea_event = NULL;	object = g_value_get_object (param_values + 0);	event = g_value_get_boxed (param_values + 1);	if (E_IS_MINICARD (object)) {		GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object);		ea_event = atk_gobject_accessible_for_object (object);		if (event->type == GDK_FOCUS_CHANGE) {			if (E_IS_MINICARD (item->canvas->focused_item))				atk_object_notify_state_change (ea_event,					ATK_STATE_FOCUSED,					event->focus_change.in);		}	}	return TRUE;}
开发者ID:Distrotech,项目名称:evolution,代码行数:26,


示例14: etcta_style_updated

static voidetcta_style_updated (ETableClickToAdd *etcta){	GtkWidget *widget;	GdkColor fg, bg, text;	widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etcta)->canvas);	e_utils_get_theme_color_color (widget, "theme_fg_color", E_UTILS_DEFAULT_THEME_FG_COLOR, &fg);	e_utils_get_theme_color_color (widget, "theme_bg_color", E_UTILS_DEFAULT_THEME_BG_COLOR, &bg);	e_utils_get_theme_color_color (widget, "theme_text_color,theme_fg_color", E_UTILS_DEFAULT_THEME_TEXT_COLOR, &text);	if (etcta->rect)		gnome_canvas_item_set (			etcta->rect,			"outline_color_gdk", &fg,			"fill_color_gdk", &bg,			NULL);	if (etcta->text)		gnome_canvas_item_set (			etcta->text,			"fill_color_gdk", &text,			NULL);}
开发者ID:moomoos,项目名称:evolution,代码行数:25,


示例15: week_view_event_item_button_release

static gbooleanweek_view_event_item_button_release (EWeekViewEventItem *event_item,                                     GdkEvent *event){	EWeekView *week_view;	GnomeCanvasItem *item;	GtkWidget *parent;	item = GNOME_CANVAS_ITEM (event_item);	parent = gtk_widget_get_parent (GTK_WIDGET (item->canvas));	g_return_val_if_fail (E_IS_WEEK_VIEW (parent), FALSE);	week_view = E_WEEK_VIEW (parent);	if (week_view->pressed_event_num != -1	    && week_view->pressed_event_num == event_item->priv->event_num	    && week_view->pressed_span_num == event_item->priv->span_num) {		e_week_view_start_editing_event (week_view,						 event_item->priv->event_num,						 event_item->priv->span_num,						 NULL);		week_view->pressed_event_num = -1;		return TRUE;	}	week_view->pressed_event_num = -1;	return FALSE;}
开发者ID:jdapena,项目名称:evolution,代码行数:30,


示例16: do_adjustment

static gbooleando_adjustment (gpointer user_data){	int row;	GtkAdjustment *adj ;	gfloat value, min_value, max_value;	EReflow *reflow = user_data;	row = reflow->cursor_row;	if (row == -1)		return FALSE;	adj = gtk_layout_get_hadjustment (GTK_LAYOUT (GNOME_CANVAS_ITEM (reflow)->canvas));	value = adj->value;	if ((!reflow->items) || (!reflow->items[row]))		return TRUE;	min_value = reflow->items[row]->x2 - adj->page_size;	max_value = reflow->items[row]->x1;	if (value < min_value)		value = min_value;	if (value > max_value)		value = max_value;	if (value != adj->value) {		adj->value = value;		gtk_adjustment_value_changed (adj);	}	reflow->do_adjustment_idle_id = 0;	return FALSE;}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:35,


示例17: gnucash_cursor_set

voidgnucash_cursor_set (GnucashCursor *cursor, VirtualLocation virt_loc){    GnucashSheet *sheet;    g_return_if_fail (cursor != NULL);    g_return_if_fail (GNUCASH_IS_CURSOR (cursor));    sheet = cursor->sheet;    gnucash_cursor_request_redraw (cursor);    gnucash_cursor_set_block (cursor, virt_loc.vcell_loc);    gnucash_cursor_set_cell (cursor,                             virt_loc.phys_row_offset,                             virt_loc.phys_col_offset);    gnucash_cursor_configure (cursor);    gnome_canvas_item_set (GNOME_CANVAS_ITEM(sheet->header_item),                           "cursor_name",                           cursor->style->cursor->cursor_name,                           NULL);    gnucash_cursor_request_redraw (cursor);}
开发者ID:814ckf0x,项目名称:gnucash,代码行数:26,


示例18: etgc_remove

static gbooleanetgc_remove (ETableGroup *etg, gint row){	ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);	GList *list;	for (list = etgc->children ; list; list = g_list_next (list)) {		ETableGroupContainerChildNode *child_node = list->data;		ETableGroup                   *child = child_node->child;		if (e_table_group_remove (child, row)) {			child_node->count --;			if (child_node->count == 0) {				e_table_group_container_child_node_free (etgc, child_node);				etgc->children = g_list_remove (etgc->children, child_node);				g_free (child_node);			} else				compute_text (etgc, child_node);			e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etgc));			return TRUE;		}	}	return FALSE;}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:26,


示例19: week_view_event_item_get_position

static ECalendarViewPositionweek_view_event_item_get_position (EWeekViewEventItem *event_item,                                   gdouble x,                                   gdouble y){	EWeekView *week_view;	GnomeCanvasItem *item;	GtkWidget *parent;	item = GNOME_CANVAS_ITEM (event_item);	parent = gtk_widget_get_parent (GTK_WIDGET (item->canvas));	g_return_val_if_fail (E_IS_WEEK_VIEW (parent), E_CALENDAR_VIEW_POS_NONE);	week_view = E_WEEK_VIEW (parent);	if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD	    || x >= item->x2 - E_WEEK_VIEW_EVENT_R_PAD)		return E_CALENDAR_VIEW_POS_NONE;	/* Support left/right edge for long events only. */	if (!e_week_view_is_one_day_event (week_view, event_item->priv->event_num)) {		if (x < item->x1 + E_WEEK_VIEW_EVENT_L_PAD		    + E_WEEK_VIEW_EVENT_BORDER_WIDTH		    + E_WEEK_VIEW_EVENT_EDGE_X_PAD)			return E_CALENDAR_VIEW_POS_LEFT_EDGE;		if (x >= item->x2 + 1 - E_WEEK_VIEW_EVENT_R_PAD		    - E_WEEK_VIEW_EVENT_BORDER_WIDTH		    - E_WEEK_VIEW_EVENT_EDGE_X_PAD)			return E_CALENDAR_VIEW_POS_RIGHT_EDGE;	}	return E_CALENDAR_VIEW_POS_EVENT;}
开发者ID:jdapena,项目名称:evolution,代码行数:35,


示例20: greeter_item_ulist_check_show_userlist

/* Hide the userlist if there are no users displayed */voidgreeter_item_ulist_check_show_userlist (void){	/*	 * If there are no users,	 * then hide the rectangle used to contain the userlist.  The	 * userlist-rect id allows a rectangle to be defined with alpha	 * behind the userlist that also goes away when the list is empty.	 */	if (num_users == 0) {		GreeterItemInfo *urinfo = greeter_lookup_id ("userlist-rect");		if (user_list != NULL)			gtk_widget_hide (user_list);		if (urinfo) {			GnomeCanvasItem *item;			if (urinfo->group_item != NULL)				item = GNOME_CANVAS_ITEM (urinfo->group_item);			else				item = urinfo->item;			gnome_canvas_item_hide (item);		}	}}
开发者ID:echofourpapa,项目名称:mdm,代码行数:29,


示例21: iti_edition_accept

/* Accepts the text in the off-screen entry of an icon text item */static voiditi_edition_accept (GnomeIconTextItem *iti){	GnomeIconTextItemPrivate *priv;	gboolean accept;	priv = iti->_priv;	accept = TRUE;	g_signal_emit (iti, iti_signals [TEXT_CHANGED], 0, &accept);	if (iti->editing){		if (accept) {			if (iti->is_text_allocated)				g_free (iti->text);			iti->text = g_strdup (gtk_entry_get_text (GTK_ENTRY(priv->entry)));			iti->is_text_allocated = 1;		}		iti_stop_editing (iti);	}	update_pango_layout (iti);	priv->need_text_update = TRUE;	gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (iti));}
开发者ID:DarkAngelII,项目名称:libgnomeui,代码行数:28,


示例22: etfci_reflow

static voidetfci_reflow (GnomeCanvasItem *item,              gint flags){	ETableFieldChooserItem *etfci = E_TABLE_FIELD_CHOOSER_ITEM (item);	gdouble old_height;	gint i;	gint count;	gdouble height = 0;	etfci_rebuild_combined (etfci);	old_height = etfci->height;	count = e_table_header_count (etfci->combined_header);	for (i = 0; i < count; i++) {		ETableCol *ecol;		ecol = e_table_header_get_column (etfci->combined_header, i);		if (ecol->spec->disabled)			continue;		height += e_table_header_compute_height (			ecol, GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas));	}	etfci->height = height;	if (old_height != etfci->height)		e_canvas_item_request_parent_reflow (item);	gnome_canvas_item_request_update (item);}
开发者ID:Oliver-Luo,项目名称:evolution,代码行数:32,


示例23: table_header_dimension_changed

static voidtable_header_dimension_changed (ETableHeader *header,                                gint col,                                ETableFieldChooserItem *etfci){	e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (etfci));}
开发者ID:Oliver-Luo,项目名称:evolution,代码行数:7,


示例24: gnc_header_set_property

static voidgnc_header_set_property (GObject *object,                         guint param_id,                         const GValue *value,                         GParamSpec *pspec){    GncHeader *header = GNC_HEADER (object);    GtkLayout *layout = GTK_LAYOUT (GNOME_CANVAS_ITEM (header)->canvas);    gboolean needs_update = FALSE;    gchar *old_name;    switch (param_id)    {    case PROP_SHEET:        header->sheet = GNUCASH_SHEET (g_value_get_object (value));        gtk_layout_set_hadjustment (layout, header->sheet->hadj);        needs_update = TRUE;        break;    case PROP_CURSOR_NAME:        old_name = header->cursor_name;        header->cursor_name = g_value_dup_string (value);        needs_update = !old_name || !header->cursor_name ||                       strcmp (old_name, header->cursor_name) != 0;        g_free (old_name);        break;    default:        G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);        break;    }    if ((header->sheet != NULL) && needs_update)        gnc_header_reconfigure (header);}
开发者ID:nishmu,项目名称:gnucash,代码行数:34,


示例25: etfci_start_drag

static voidetfci_start_drag (ETableFieldChooserItem *etfci,                  GdkEvent *event,                  gdouble x,                  gdouble y){	GtkWidget *widget = GTK_WIDGET (GNOME_CANVAS_ITEM (etfci)->canvas);	GtkTargetList *list;	GdkDragContext *context;	ETableCol *ecol;	cairo_surface_t *cs;	cairo_t *cr;	gint drag_col;	gint button_height;	GtkTargetEntry  etfci_drag_types[] = {		{ (gchar *) TARGET_ETABLE_COL_TYPE, 0, TARGET_ETABLE_COL_HEADER },	};	if (etfci->combined_header == NULL)		return;	drag_col = etfci_find_button (etfci, y);	if (drag_col < 0 || drag_col > e_table_header_count (etfci->combined_header))		return;	ecol = e_table_header_get_column (etfci->combined_header, drag_col);	if (ecol->spec->disabled)		return;	etfci->drag_col = ecol->spec->model_col;	etfci_drag_types[0].target = g_strdup_printf (		"%s-%s", etfci_drag_types[0].target, etfci->dnd_code);	d (g_print ("etfci - %s/n", etfci_drag_types[0].target));	list = gtk_target_list_new (etfci_drag_types, G_N_ELEMENTS (etfci_drag_types));	context = gtk_drag_begin (widget, list, GDK_ACTION_MOVE, 1, event);	g_free ((gpointer) etfci_drag_types[0].target);	button_height = e_table_header_compute_height (ecol, widget);	cs = cairo_image_surface_create (		CAIRO_FORMAT_ARGB32,		etfci->width, button_height);	cr = cairo_create (cs);	e_table_header_draw_button (		cr, ecol,		widget, 0, 0,		etfci->width, button_height,		etfci->width, button_height,		E_TABLE_COL_ARROW_NONE);	gtk_drag_set_icon_surface (context, cs);	cairo_surface_destroy (cs);	cairo_destroy (cr);	etfci->maybe_drag = FALSE;}
开发者ID:Oliver-Luo,项目名称:evolution,代码行数:60,


示例26: idle_move_item

static gbooleanidle_move_item (gpointer data){  BstCanvasSource *self = data;  GnomeCanvasItem *item = GNOME_CANVAS_ITEM (self);  GDK_THREADS_ENTER ();  if (self->source && item->canvas)    {      SfiReal x, y;      bse_proxy_get (self->source,                     "pos-x", &x,                     "pos-y", &y,                     NULL);      x *= BST_CANVAS_SOURCE_PIXEL_SCALE;      y *= -BST_CANVAS_SOURCE_PIXEL_SCALE;      gnome_canvas_item_w2i (item, &x, &y);      g_object_freeze_notify (G_OBJECT (self));      gnome_canvas_item_move (item, x, y);      /* canvas notification bug workaround */      g_object_notify (self, "x");      g_object_notify (self, "y");      g_object_thaw_notify (G_OBJECT (self));    }  self->idle_reposition = FALSE;  g_object_unref (self);  GDK_THREADS_LEAVE ();  return FALSE;}
开发者ID:whitelynx,项目名称:beast,代码行数:29,


示例27: idle_do_action

static gbooleanidle_do_action (gpointer data){	GtkLayout *layout;	GdkEventButton event;	ETableClickToAdd * etcta;	gint finished;	g_return_val_if_fail (data!= NULL, FALSE);	etcta = E_TABLE_CLICK_TO_ADD (		atk_gobject_accessible_get_object (		ATK_GOBJECT_ACCESSIBLE (data)));	g_return_val_if_fail (etcta, FALSE);	layout = GTK_LAYOUT (GNOME_CANVAS_ITEM (etcta)->canvas);	event.x = 0;	event.y = 0;	event.type = GDK_BUTTON_PRESS;	event.window = gtk_layout_get_bin_window (layout);	event.button = 1;	event.send_event = TRUE;	event.time = GDK_CURRENT_TIME;	event.axes = NULL;	g_signal_emit_by_name (etcta, "event", &event, &finished);	return FALSE;}
开发者ID:Distrotech,项目名称:evolution,代码行数:30,



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


C++ GNT_TREE函数代码示例
C++ GNIX_WARN函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。