PHP-GTK
Sunday, December 21, 2014 
download | documentation | applications | faq | changelog | resources 


search for in the  


previousGtkTreeView::insert_column
GtkTreeView::move_column_afternext

Last updated: Sun, 12 May 2013
view this page in English

GtkTreeView::insert_column_with_data_func

This method inserts a new column into a GtkTreeView at the given position with a given name. In contrast to insert_column() and append_column() this method creates the column object internally and allows you to specify a data function, which is called everytime a cell in the model for this column changed and needs to be rendered.

The provided callback function receives the following parameters to act on them:

Inside the data function you most propably want to change the GtkCellRenderer, which is responsible for displaying.

Example 142. Using insert_column_with_data_func()

<?php
//Using GtkTreeView::insert_column_with_data_func()
 
/*
 * Creating a column with a data function callback
 */
$nameRenderer = new GtkCellRendererText();
$view->insert_column_with_data_func(
                                    0,
                                    "Test suites",
                                    $nameRenderer,
                                    "showTestName"
                                    );
 
/*
 * This data function column makes the cell renderer display the text from model
 * column 0 in uppercase letters.
 */
function showTestName($column, $cell, $model, $iter)
{
    $cell->set_property(
                        "text",
                        strtoupper( $model->get_value($iter, 0))
                        );
}
?>

User Contributed Notes
gtk.gtktreeview.method.insert_column_with_data_func.php
add a note about notes
There are no user contributed notes for this page.


previousGtkTreeView::insert_column
GtkTreeView::move_column_afternext

Last updated: Sun, 12 May 2013
view this page in English


credits 

PHP  Copyright © 2001-2014 The PHP Group
 All rights reserved.
Last updated: Sun May 12 20:51:01 2013 CEST