static void destroy_notify (GTKObject *self)
{
    [self dealloc];
}

 - initWithGtk:(gpointer) _gtk
{
    [super initWithGtk:_gtk];

    // disable floating flag, we use autorelease instead...
    GTK_OBJECT_UNSET_FLAGS(_gtk, GTK_FLOATING);
    [self weakref:(GtkDestroyNotify) destroy_notify data:self];

    if (![self isKindOfClass:[GTKWindow class]] &&
	![self isKindOfClass:[GTKMenu class]] &&
	[self respondsToSelector:@selector(show)]) [(id) self show];
    return self;
}

#define gtk	((GtkObject *) gtk)
 - (oneway void) release
{
#ifdef DEBUG
    if (gtk->ref_count == 0)
	g_error("ref_count == 0 in " __FILE__ " (release)");
#endif
    [self unref];
}

 - retain
{
    if (gtk) [self ref];
    return self;
}

 - (unsigned) retainCount
{
    return gtk->ref_count;
}
#undef gtk
