Re: [pygtk] Does ctree.selection work?



On Tue, 14 Aug 2001, Christian Robottom Reis wrote:


Has anybody successfully used ctree's selection attribute? In my case,
it returns:

[137051380]

That's weird.  ctree.selection should be calling
gtk_ctree_get_selection(), which should be treating the data members of
the list as GtkCTreeNodes.


or another odd list with an int inside it. Is this expected? From my view
of the code:

for (selection = GTK_CLIST(PyGtk_Get(clist))->selection; selection !=
NULL;
       selection = selection->next) {
    row = GPOINTER_TO_UINT(selection->data);
    py_int = PyInt_FromLong(row);

this might be wrong - isn't selection->data a GtkCTreeRow?

CTree is an evil widget in many ways.  GTK_CLIST(w)->selection is a
list of ints for CList, but for CTrees it is a list of nodes.

The code in GtkCTree.__getattr__ should be catching this lookup before it
recurses to GtkCList.__getattr__.

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]