Re: Doubts creating new Objects



Jaka Mocnik wrote:
> > >From now on, I must cast the new object everytime I do something
> > like this:
> > gnome_mdi_add_child (GNOME_MDI(mdi), GNOME_MDI_CHILD (page));
> > GNOME_MDI(mdi)->active_view
> > so, is there an extra work? or the cast won't affect perfomance?.
> effect on the performance depends on the debugging settings.

What this settings are? And how big is the perfomance loss?
 
> > NewObject->ParentObject
> >
> > So I can do:
> >
> > gnome_mdi_add_child (MyMDI->mdi, GNOME_MDI_CHILD (page));
> > GNOME_MDI(MyMDI->mdi)->active_view
> >
> > I would love to hear why this is bad!.
> why would it be bad?

Don't know ;). Perhaps poor design: it's not the way GTK Object System
works.
It can be harder to read. Also it's better to cast objects if it means
easier debug AND there is no perfomance lost in production code.

I only need to hear about the debug settings you told me. If there is
only
a bit extra typing and no perfomance loss (in production code), I would
be
very happy to write programs in C and casting everywhere :).

> regards,
>         jaKa
Thanks a lot.

Manuel Clos.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]