Re: spinning boxes

From: Date: Sat, 14 Jan 2006 19:33:58 +0000
Subject: Re: spinning boxes
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-2207@lists.php.net to get a copy of this message
On Jan 13, 2006, at 4:32 AM, Christian Weiske wrote:
gtk_tree_view_column_cell_get_size(GTK_TREE_VIEW_COLUMN(PHPG_GOBJECT(this_ptr)), &cell_area, &x_offset, &y_offset, &width, &height);
    phpg_gboxed_new(&cell_area2, GDK_TYPE_RECTANGLE, &cell_area, TRUE,
TRUE TSRMLS_CC);
    php_gtk_build_value(&return_value, "(Viiii)", cell_area2, x_offset,
y_offset, width, height); } %% }}} ------- but that doesn't work (segfaults). If you remove the phpg_gboxed_new and return cell_area instead of cell_area, the method works but the first array key is something like
[0]=> &UNKNOWN:0
So I thought there has to be a call to phpg_gboxed_new, but I just don't know how that works and what it does :/
phpg_gboxed_new() initializes cell_area2 to have a refcount of 1. When you call php_gtk_build_value() and use 'V' specifier it will add increment the refcount. Since we have just created cell_area2 we don't want that, so use 'N' specifier for that. By the way, preferred names of PHP wrappers are php_*. So call it php_cell_area. -Andrei

« previous php.gtk.dev (#2207) next »