|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26067 node_get_cell_style doesn't work
Submitted: 2003-11-01 00:25 UTC Modified: 2005-09-23 15:33 UTC
From: cweiske at cweiske dot de Assigned:
Status: Closed Package: PHP-GTK related
PHP Version: 1.0.0 (PHP-GTK) OS: windows xp
Private report: No CVE-ID: None
 [2003-11-01 00:25 UTC] cweiske at cweiske dot de
The "node_get_cell_style" of the GtkCTree widget does not work, it just returns NULL. The same problem should apply to the GtkCList.

Reproduce code:
dl( "php_gtk." . ( strstr( PHP_OS, "WIN") ? "dll" : "so"));
function delete_event() { return false; }
function destroy() { Gtk::main_quit(); }
$window = &new GtkWindow();
$window->set_default_size( 200, 200);
$window->connect('destroy', 'destroy');
$window->connect('delete-event', 'delete_event');
$tree	= &new GtkCTree( 1, 0, array( "Style"));
$window->add( $tree);

$node	= $tree->insert_node( null, null, array( "Text"), 5, null, null, null, null, false, false);
$nodestyle	= $tree->node_get_cell_style( $node, 0);
print_r( $nodestyle);//should be NOT null
$col1 = &new GdkColor(0, 56000, 0);
$nodestyle->base[GTK_STATE_NORMAL] = $col1;
$tree->node_set_cell_style( $node, 0, $nodestyle);

Expected result:
the cell style of the first tree cell should have a nice color


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-17 11:34 UTC]
Apologies Christian, I didn't notice this report was outstanding until today's bug summary came through.  

Looking into it.
 [2004-01-19 00:17 UTC]
Actually it's returning a stdClass instead of a GtkStyle object - but only if the style hasn't been set using node_set_cell_style().  It looks like the style object isn't being initialised at the point of realization. The question is whether this is deliberate :)  I'm still trying to verify this, one way or the other.

BTW you're correct in assuming that the GtkCList equivalent works in much the same way; they use the same internal objects way deep in the mix (clistrow, cell).

 [2004-01-28 18:23 UTC]
By default the CTreeNodes do not have styles set. There are couple of things wrong with your script, consequently. You have to create a new style via "new GtkStyle()". Then you have to allocate the color correctly, by getting a colormap and using alloc() call on it. I modified the code to do that and it worked.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 02:01:29 2024 UTC