Re: use of = &new object versus = new object
| From: | Malk0 | Date: | Mon, 11 Jul 2005 19:15:16 +0000 |
| Subject: | Re: use of = &new object versus = new object | ||
| References: | 1 2 3 4 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5979@lists.php.net to get a copy of this message | ||
2005/7/11, Madeleine D. <mmdrake@bctonline.com>:
>
> I think Jake has asked a very good question. Since he ran into his earlier
> problem and removed the reference on the new objects, I've taken to trying
> the same thing in my code. So far, I don't see a difference - either for
> performance or for causing any kind of problems. My screens seem to behave
> the same way, with or without the = & new.
>
> I understand about references and how they work, but as he points out, all
> of our GtkObjects are new items, and generally don't need references at
> that point. So why do we do it??
>
> Madeleine D.
Effectively i made some quick test with some code i've lot trouble to
use without & in the past and it actually seem to work without now!
That's really strange, i remember that i passed 3 weeks to understand
that i was obliged to put & to get this code work when i wrote it ( i
used php-gtk 0.52 at that time) and now the same code work perfectly
without the &. Is this due to php or to the gtk binding? don't know.
What i think is that gtk object have unique ref in php (actual
version) $gtkobject->{'0'} and i imagine that the gtk engine use this
reference internally to point the gtkwidget.
If someone can bring some light ....
nathan