GtkCellLayout::set_cell_data_func
| From: | Christian Weiske | Date: | Thu, 19 Jan 2006 21:58:53 +0000 |
| Subject: | GtkCellLayout::set_cell_data_func | ||
| Groups: | php.gtk.dev | ||
| Request: | Send a blank email to php-gtk-dev+get-2228@lists.php.net to get a copy of this message | ||
Hi
One more function, copied from the GtkTreeViewColumn implementation.
Demo script:
$entry = new GtkEntry();
$compl = new GtkEntryCompletion();
$entry->set_completion($compl);
$store = new GtkListStore(Gtk::TYPE_STRING);
$compl->set_model($store);
$compl->set_text_column(0);
$store->append(array('small'));
$store->append(array('little'));
$store->append(array('lowercase'));
$renderer = new GtkCellRendererText();
$compl->clear();
$compl->pack_start($renderer, true);
$compl->set_cell_data_func($renderer, 'makeUpper');
function makeUpper($column, $cell, $model, $iter) {
$info = $model->get_value($iter, 0);
$cell->set_property('text', strtoupper($info));
}
$wnd = new GtkWindow();
$wnd->add($entry);
$wnd->connect_simple('destroy', array('gtk', 'main_quit'));
$wnd->show_all();
Gtk::main();
--
Regards/MfG,
Christian Weiske
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc