|
GtkType
gnome_canvas_card_get_type (void)
{
static GtkType canvas_card_type = 0;
if (!canvas_card_type) {
static const GtkTypeInfo canvas_card_info = {
"GnomeCanvasCard",
sizeof (GnomeCanvasCard),
sizeof (GnomeCanvasCardClass),
(GtkClassInitFunc) gnome_canvas_card_class_init,
(GtkObjectInitFunc) gnome_canvas_card_init,
NULL, /* reserved_1 */
NULL, /* reserved_2 */
(GtkClassInitFunc) NULL
};
canvas_card_type = gtk_type_unique (gnome_canvas_item_get_type (),
&canvas_card_info);
}
return canvas_card_type;
}
定义了一个类型,在函数gnome_canvas_card_class_init中指定了:
object_class->destroy = gnome_canvas_card_destroy;
使用item=gnome_canvas_item_new(GNOME_CANVAS_GROUP(parent),
gnome_canvas_card_get_type(),
"rank",card->rank,"suit",card->suit,
NULL);
创造了这样一个类型的实例,
在使用gtk_object_destroy(GTK_OBJECT(item))释放这个实例的时候,
函数gnome_canvas_card_destroy被调用了两次,谁知到这是怎么一回事吗?
参见附件中test-0.1的callback.c.
test-0.1在install了 gnome-canvas-card-0.6.tar.gz 以后才会正常 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|