Re: Request for GtkWidget::set_visible(boolean) method
| From: | Andrei Zmievski | Date: | Tue, 28 Mar 2006 17:56:47 +0000 |
| Subject: | Re: Request for GtkWidget::set_visible(boolean) method | ||
| References: | 1 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-2688@lists.php.net to get a copy of this message | ||
I am kind of wary of adding our own methods to Gtk+ widgets.. We could implement all kinds of nice stuff to make API easier, but where do we draw the line?
-Andrei
On Mar 28, 2006, at 1:58 AM, Christian Weiske wrote:
Hello all, Currently, the only way to show/hide a widget in gtk2 is to use the show() or hide() method. It is not possible to call a method with a boolean parameter (as in e.g. set_sensitive(boolean)) to dynamically modify the visibility of the widget. I have the case that I need to show/hide some menu items dynamically depending on a liststore value, but I need to make an if block to call the right method: if ($model->get_value($iter, 10)) { $item->hide(); } else { $item->show(); } With set_sensitive, it's easy: $item->set_sensitive($model->get_value($iter, 10)); Can we add a set_visible() method to the GtkWidget class? -- Regards/MfG, Christian Weiske