Re: Request for GtkWidget::set_visible(boolean) method
| From: | Cory Christison | Date: | Tue, 28 Mar 2006 14:04:52 +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-2686@lists.php.net to get a copy of this message | ||
[long time reader, first time writer]
What about:
<?php
$show_hide = ( $model->get_value($iter, 10) ? 'hide' : 'show' ); // should it be get_value($item, 10) ???
$item->$show_hide();
?>
I've never really done anything like this, but to my knowledge it should work?
- Cory Christison
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?