adding a row to liststore not working - ridiculous exception

  • Last Update :
  • Techknowledgy :

Every time I do .append() on ListStore object I get such error:

Traceback(most recent call last):
   File "./music.py", line 85, in create
self.albums_list.append(new_entry)
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 945, in append
return self._do_insert(-1, row)
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 936, in _do_insert
row, columns = self._convert_row(row)
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 844, in _convert_row
result.append(self._convert_value(cur_col, value))
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 862, in _convert_value
return GObject.Value(self.get_column_type(column), value)
File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 214, in __init__
self.init(value_type)
TypeError: Must be gobject.GType, not gobject.GType

Suggestion : 2

3 days ago Dec 16, 2013  · First the code: from gi.repository import Gtk, GtkSource, GObject import os.path import shelve class MusicCollection(object): def __init__(self): self.builder = Gtk ... ,  › Is it possible to restrict typescript object to contain only properties defined by its class , 1 day ago This in itself is not very useful yet of course. We will add data to the rows in the next section. Adding Rows to a Tree Store. Adding rows to a tree store works similar to adding rows to a … ,  › How can i select the record with the 2nd highest salary in database oracle


Traceback(most recent call last): File "./music.py", line 85, in create self.albums_list.append(new_entry) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 945, in append
return self._do_insert(-1, row) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 936, in _do_insert row, columns = self._convert_row(row) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 844, in _convert_row result.append(self._convert_value(cur_col, value)) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 862, in _convert_value
return GObject.Value(self.get_column_type(column), value) File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 214, in __init__ self.init(value_type) TypeError: Must be gobject.GType, not gobject.GType
Traceback(most recent call last): File "./music.py", line 85, in createself.albums_list.append(new_entry) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 945, in appendreturn self._do_insert(-1, row) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 936, in _do_insertrow, columns = self._convert_row(row) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 844, in _convert_rowresult.append(self._convert_value(cur_col, value)) File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 862, in _convert_valuereturn GObject.Value(self.get_column_type(column), value) File "/usr/lib/python3/dist-packages/gi/overrides/GObject.py", line 214, in __init__self.init(value_type) TypeError: Must be gobject.GType, not gobject.GType

Suggestion : 3

Having learned how to add, manipulate, and retrieve data from a store, the next step is to get that data displayed in a GtkTreeView widget.,get_n_columns: how many data fields per row are visible to the outside that uses gtk_tree_model_get, e.g. cell renderer attributes,As tree iters are only valid for a short time, they are usually allocated on the stack, as in the following example (keep in mind that GtkTreeIter is just a structure that contains data fields you do not need to know anything about):,So far we have only put text in the tree view. While everything you need to know to display icons (in the form of GdkPixbufs) has been introduced in the previous sections, a short example might help to make things clearer. The following code will pack an icon and some text into the same tree view column:

GtkListStore * list_store;

list_store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_UINT);
void
onTreeViewRowActivated(GtkTreeView * view,
   GtkTreePath * path,
   GtkTreeViewColumn * col,
   gpointer userdata) {
   GtkTreeModel * model = gtk_tree_view_get_model(view);

   GtkTreeIter iter;
   if (gtk_tree_model_get_iter(model, & iter, path)) {
      char * name;

      gtk_tree_model_get(model, & iter, COL_NAME, & name, -1);

      g_print("The row containing the name '%s' has been double-clicked.\n", name);

      g_free(name);
   }
}
void
traverse_list_store(GtkListStore * liststore) {
   GtkTreeIter iter;
   gboolean valid;

   g_return_if_fail(liststore != NULL);

   /* Get first row in list store */
   valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(liststore), & iter);

   while (valid) {
      /* ... do something with that row using the iter ...          */
      /* (Here column 0 of the list store is of type G_TYPE_STRING) */
      gtk_list_store_set(liststore, & iter, 0, "Joe", -1);

      /* Make iter point to the next row in the list store */
      valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(liststore), & iter);
   }
}
GtkListStore * liststore;
GtkTreeIter iter;

liststore = gtk_list_store_new(1, G_TYPE_STRING);

/* Append an empty row to the list store. Iter will point to the new row */
gtk_list_store_append(liststore, & iter);

/* Append an empty row to the list store. Iter will point to the new row */
gtk_list_store_append(liststore, & iter);

/* Append an empty row to the list store. Iter will point to the new row */
gtk_list_store_append(liststore, & iter);
GtkListStore * treestore;
GtkTreeIter iter, child;

treestore = gtk_tree_store_new(1, G_TYPE_STRING);

/* Append an empty top-level row to the tree store.
 *  Iter will point to the new row */
gtk_tree_store_append(treestore, & iter, NULL);

/* Append another empty top-level row to the tree store.
 *  Iter will point to the new row */
gtk_tree_store_append(treestore, & iter, NULL);

/* Append a child to the row we just added.
 *  Child will point to the new row */
gtk_tree_store_append(treestore, & child, & iter);

/* Get the first row, and add a child to it as well (could have been done
 *  right away earlier of course, this is just for demonstration purposes) */
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(treestore), & iter)) {
   /* Child will point to new row */
   gtk_tree_store_append(treestore, & child, & iter);
} else {
   g_error("Oops, we should have a first row in the tree store!\n");
}

Suggestion : 4

so not the same problem like # 4 Treeview suddenly stopped working in Navbar , 16Treeview suddenly stopped working in Navbar ,Help please, i integrate treeview in sidebar and edit monobook.css, but all the same i see a white block with width 100%. In ie6 this block down on content. ,i tried to want to use ... "Adding a treeview to the sidebar (if using monobook skin)"

.fancytree.root p {
   display: inline;
}
<div class="portlet"> ... </div>
    $args = $this - > args[$root];
    $args = $this - > args[$id];
Notice: Undefined index: in / hermes / bosweb / .../public_html/wiki / extensions / Treeview5 / Treeview5.php on line 132
{
   {
      #tree:
         *
         Articles in [
            [: Category: Service]
         ] {
            {
               #dpl: category = Service | format = ,
               ** ,
               [
                  [ % NAME % ]
               ]\ n,
            }
         }
   }
}

Suggestion : 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL),Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.,Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question. , featuresstuff Competitions News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys CodeProject Stuff

1._
CategoryName SubCategoryName SubCategory2Name
ASV G - 1 Error
ASV SV Error
LYT
INS Script
INS Export cc07
INS How To
INS Notes
2._
tn.Nodes.Add(dr["Child"].ToString());
3._
treeView1.BeginUpdate();

foreach(DataRow r in parent.Rows) {
   tn = treeView1.Nodes.Add(r["ID"].ToString(), r["Parent"].ToString());

   foreach(DataRow dr in child.Rows) {
      treeView1.Nodes[treeView1.Nodes.IndexOf(tn.Parent)].Nodes.Add(dr["Child"].ToString());
   }

}
treeView1.EndUpdate();
treeView1.BeginUpdate();

foreach(DataRow r in parent.Rows) {
   tn = treeView1.Nodes.Add(r["ID"].ToString(), r["Parent"].ToString());

   foreach(DataRow dr in ? ) // replace '?' with something that retruns child DataRows of 'r !
   {
      tn.Nodes.Add(dr["Child"].ToString());
   }

}
treeView1.EndUpdate();