[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: macro IS_xxx
- From: Paul Pogonyshev <pogonyshev gmx net>
- To: gtk-app-devel-list gnome org
- Subject: Re: macro IS_xxx
- Date: Sun, 24 Jun 2007 13:35:12 +0300
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?
>
> is it a bug? or is it normal? or am i mistaking something?
It is doing what it should. It is like dynamic_cast in C++ or
instanceof in Java or isinstance in Python. Although type of
obj_b is B, it is also an instance of A since B derives from A.
Paul
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]