Re: screwed up newlines?
| From: | Andrei Zmievski | Date: | Sun, 06 Aug 2006 15:35:01 +0000 |
| Subject: | Re: screwed up newlines? | ||
| References: | 1 | Groups: | php.gtk.doc |
| Request: | Send a blank email to php-gtk-doc+get-2767@lists.php.net to get a copy of this message | ||
I don't think it's a matter of them deciding to phase it out or not. Some things are accessible -only- as fields, and some are -only- as properties. We need to figure out what to do when we have an overlap: use property API or use direct field access. I can tell you that from the performance point of view, fields will be faster, but I haven't benchmarked by how much. Someone want to try?
As for the dashes vs. underscores in this overlapped area, I've already said that I'd rather people used underscores, for consistency's sake.
-Andrei
On Aug 6, 2006, at 3:30 AM, Steph Fox wrote:
All - can we please have a discussion about the line we're taking on properties in docs? I know GTK+ manual plumped for hyphens (I guess that's why Christian did the same), but as he pointed out earlier, PHP won't accept hyphens unless they're quoted, which of course they always are if you're using get|set_property(). This is OK except when we have widget fields that are directly accessible but are also widget properties. I guess the chief question is whether the GTK+ team intend phasing out publicly accessible fields in the long term, in which case we'd do better to encourage PHP-GTK users to use get|set property for access anywhere they can (and Christian's approach then makes sense). Does anyone have any word on this? Chris, this really _is_ a CS issue for docs and we need to come to a group decision on it. - Steph--PHP-GTK Documentation Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpSteph,Some are both. C:\php5>php -a Interactive mode enabled <?php $win = new GtkWindow(); $win->set_property('allow_shrink', true); echo $win->allow_shrink; 1 $win->set_property('allow_shrink', false); echo $win->allow_shrink; 0 ?> set_property() works with both underscore and hyphen, but fields ONLY work with underscores: C:\php5>php -a Interactive mode enabled <?php $win = new GtkWindow(); $win->set_property('allow-shrink', true); echo $win->allow-shrink; Notice: Undefined property: GtkWindow::$allow in C:\php5\- on line 4 Notice: Use of undefined constant shrink - assumed 'shrink' in C:\php5\- on line 4 0 echo $win->allow_shrink; 1 echo $win->get_property('allow-shrink'); 1 ?> That's exactly why I think it's going to lead to confusion.I'm having problems with that leap from 'this is what properties are' (which is known) to 'Thus, dashes in the names are ok'.PHP would not allow the following:echo $widget->is-realized;but this works:echo $widget->get_property('is-realized');Further, I doubt that using underscores instead of dashes would be liked by gtk.That'd be funny, because they're _all_ underscores in GTK source :)--Regards/MfG, Christian Weiske--PHP-GTK Documentation Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __________ NOD32 1.1380 (20060125) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com