php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54175 GtkCellRendererCombo changed signal missing GtkTreeIter parameter on callback
Submitted: 2011-03-06 16:21 UTC Modified: 2011-03-06 17:05 UTC
From: ptlis at ptlis dot net Assigned:
Status: Not a bug Package: PHP-GTK related
PHP Version: 5.3.5 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ptlis at ptlis dot net
New email:
PHP Version: OS:

 

 [2011-03-06 16:21 UTC] ptlis at ptlis dot net
Description:
------------
The changed signal should provide a GtkTreeIter as documented here:

http://library.gnome.org/devel/gtk/stable/GtkCellRendererCombo.html#GtkCellRendererCombo.signal-details

Without this parameter passed to callbacks there is no sane mechanism to get data from other columns in the GtkListStore.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-06 16:54 UTC] ptlis at ptlis dot net
Basic test case of what should occur:

<?php

	class test {
		protected	$str;

		public function __construct($str) {
			$this->str	= $str;
		}
	}


	$window		= new GtkWindow();
	$window->set_size_request(400, 400);


	// Tree Model
	$treeModel	= new GtkTreeStore(GObject::TYPE_STRING);
	$treeModel->append(null, array('foo'));

	// Tree View
	$treeView	= new GtkTreeView();
	$treeView->set_model($treeModel);
	$window->add($treeView);

	// Combo Model
	$comboModel	= new GtkListStore(GObject::TYPE_STRING, GObject::TYPE_PHP_VALUE);
	$comboModel->append(array('foo', new test('foo')));
	$comboModel->append(array('bar', new test('bar')));
	$comboModel->append(array('baz', new test('baz')));

	// Combo renderer
	$renderer			= new GtkCellRendererCombo();
	$renderer->set_property('model', $comboModel);
	$renderer->set_property('text-column', 0);
	$renderer->set_property('editable', true);
	$renderer->set_property('has-entry', false);
	$column				= new GtkTreeViewColumn('column:', $renderer, 'text', 0);
	$treeView->append_column($column);

    $renderer->connect('edited', 'combo_change');

	function combo_change(GtkCellRendererText $cell, $path, $selectionText/*, GtkTreeIter $treeIter*/) {
/*
		$class	= $cell->model->get_value($treeIter->iter, 1);
*/
		echo 'changed' . "\n";
	}

	$window->show_all();
	Gtk::main();
 [2011-03-06 17:05 UTC] markskilbeck@php.net
-Status: Open +Status: Bogus
 [2011-03-06 17:05 UTC] markskilbeck@php.net
You're using the 'edited' signal - not the 'changed' signal. For the 'changed' 
signal, the GtkTreeIter is the third argument passed to the callback.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Jan 28 19:01:26 2020 UTC