Remove deprecated code: GtkLabel

This commit is contained in:
Javier Jardón
2009-10-10 06:45:03 +02:00
committed by Javier Jardón
parent b5917e7a6f
commit fead8cd49a
7 changed files with 14 additions and 85 deletions

View File

@ -117,7 +117,7 @@ gint main( int argc,
*/
for (i = 0; i < 5; i++) {
GtkWidget *label;
gchar *string;
const gchar *string;
sprintf(buffer, "ListItemContainer with Label #%d", i);
label=gtk_label_new (buffer);
@ -126,7 +126,7 @@ gint main( int argc,
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (gtklist), list_item);
gtk_widget_show (list_item);
gtk_label_get (GTK_LABEL (label), &string);
string = gtk_label_get_text (GTK_LABEL (label));
g_object_set_data (G_OBJECT (list_item), list_item_data_key, string);
}
/* Here, we are creating another 5 labels, this time

View File

@ -7,14 +7,14 @@
static void cb_itemsignal( GtkWidget *item,
gchar *signame )
{
gchar *name;
const gchar *name;
GtkLabel *label;
/* It's a Bin, so it has one child, which we know to be a
label, so get that */
label = GTK_LABEL (GTK_BIN (item)->child);
label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item)));
/* Get the text of the label */
gtk_label_get (label, &name);
name = gtk_label_get_text (label);
/* Get the level of the tree which the item is in */
g_print ("%s called for item %s->%p, level %d\n", signame, name,
item, GTK_TREE (item->parent)->level);
@ -47,14 +47,14 @@ static void cb_selection_changed( GtkWidget *tree )
i = GTK_TREE_SELECTION_OLD (tree);
while (i) {
gchar *name;
const gchar *name;
GtkLabel *label;
GtkWidget *item;
/* Get a GtkWidget pointer from the list node */
item = GTK_WIDGET (i->data);
label = GTK_LABEL (GTK_BIN (item)->child);
gtk_label_get (label, &name);
label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item)));
name = gtk_label_get_text (label);
g_print ("\t%s on level %d\n", name, GTK_TREE
(item->parent)->level);
i = i->next;