Re: Request for GtkWidget::set_visible(boolean) method
| From: | Andrei Zmievski | Date: | Thu, 06 Apr 2006 04:35:24 +0000 |
| Subject: | Re: Request for GtkWidget::set_visible(boolean) method | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2718@lists.php.net to get a copy of this message | ||
On Mar 28, 2006, at 6:36 AM, Scott Mattocks wrote:
I have attached a patch that doesn't work. I don't know why it doesn't work but it doesn't. If anyone could point me in the right direction for making it work, I would appreciate it. Everything compiles, and the method is callable and I added a return value to verify that the values passed in are correct. It just doesn't hide the widget when I call it. Thanks, + +%% +add GtkWidget set_visible +PHP_METHOD +{That was really puzzling, until I realized that you declared the variables as 'gboolean'. The php_gtk_parse_args() expects the boolean vars to be of type 'zend_bool'. gboolean is actually a gint, and zend_bool is an unsigned char. So when you pass a pointer to visible to the function, it casts it as (zend_bool*) and then fills in only the lower byte. The upper ones are filled with garbage and the result always comes out to be true. -Andrei+ gboolean visible, all = TRUE;