You are not logged in.
Hi guys:
Having this strange critical message. This is my code:
#include <gtk/gtk.h>
/* compile with: */
/* gcc main.c -o boxy `pkg-config --cflags --libs gtk+-2.0` */
typedef struct {
GtkWidget *toplevel;
GtkWidget *treeview;
} Widgets;
enum { ITEM_PARENT, ITEM_CHILD };
typedef struct {
gint tipo;
gint id;
gchar *nombre;
gint cantidad;
} Lista;
void setupTree (GtkTreeView *tv) {
const Lista lista[] = {
{ITEM_PARENT, 125, "Superman", 2},
{ITEM_CHILD, 23, "Batman", 1},
{ITEM_PARENT, 65, "Iron Man", 2},
{-1, -1, NULL}
};
GtkTreeStore *model;
GtkTreeIter last;
gint pos;
model = gtk_tree_store_new (3, G_TYPE_INT, G_TYPE_STRING, G_TYPE_INT);
g_object_ref (model);
gtk_tree_view_insert_column_with_attributes (tv, -1, "ID", gtk_cell_renderer_text_new (), "text", 0, NULL);
gtk_tree_view_insert_column_with_attributes (tv, -1, "Nombre", gtk_cell_renderer_text_new (), "text", 1, NULL);
gtk_tree_view_insert_column_with_attributes (tv, -1, "Cantidad", gtk_cell_renderer_text_new (), "text", 2, NULL);
for (pos = 0; lista[pos].tipo != -1; pos++) {
GtkTreeIter iter;
if (lista[pos].tipo == ITEM_PARENT) {
gtk_tree_store_append (model, &iter, NULL);
last = iter;
} else if (lista[pos].tipo == ITEM_CHILD) {
gtk_tree_store_append (model, &iter, &last);
}
gtk_tree_store_set (model, &iter, 0, lista[pos].id, 1, lista[pos].nombre, 2, lista[pos].cantidad, -1);
}
gtk_tree_view_set_model (tv, GTK_TREE_MODEL (model));
g_object_unref (model);
}
int main (int argc, char *argv[]) {
Widgets *ptr;
GtkWidget *scroll;
gtk_init (&argc, &argv);
ptr = g_slice_new0(Widgets);
ptr->toplevel = gtk_window_new (GTK_WINDOW_TOPLEVEL);
scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_OUT);
ptr->treeview = gtk_tree_view_new ();
setupTree (GTK_TREE_VIEW (ptr->treeview));
g_signal_connect (ptr->toplevel, "destroy", G_CALLBACK (gtk_main_quit), NULL);
gtk_container_set_border_width (GTK_CONTAINER (ptr->toplevel), 10);
gtk_container_add (GTK_CONTAINER (scroll), ptr->treeview);
gtk_container_add (GTK_CONTAINER (ptr->toplevel), scroll);
gtk_widget_show_all (ptr->toplevel);
gtk_main ();
g_slice_free (Widgets, ptr);
return 0;
}
The window is showed correctly, but when I click in the "plus" to expand them I get this messages in the terminal, any ideas?
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
* AUR contributor.
Offline
i get a similar message when starting sublime. I have been searching for a fix but until now nothing. If/when i find something ill be sure to pass it along
(sublime_text:3913): GLib-CRITICAL **: Source ID 21540 was not found when attempting to remove it
Offline
per this post http://stackoverflow.com/questions/2319 … -remove-it
seems like it isnt critical. If somone else could weigh in ..
Offline