[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: macro IS_xxx
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-app-devel-list gnome org
- Subject: Re: macro IS_xxx
- Date: Sun, 24 Jun 2007 10:32:50 +0200
On Sun, Jun 24, 2007 at 09:48:01AM +0200, Andrea Zagli wrote:
> i have GObject A and GObject B; B is a A's subclass
>
> obj_a = a_new ();
> obj_b = b_new ();
>
> (a_new() and b_new() return GObject)
>
> when i call IS_OBJECT_A (obj_b) it returns TRUE: why?
Because obj_b *is* also an instance of A. That's the
whole point of subclassing.
To check the exact type you can get it with
G_TYPE_FROM_INSTANCE and compare. However, in most cases
needing this means there's something wrong with your design.
> is it a bug? or is it normal?
Show me a single object system implementation that behaves
differently in this regard...
Yeti
--
http://gwyddion.net/
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]