forked from AuroraMiddleware/gtk
remove unused variable.
2005-07-13 Manish Singh <yosh@gimp.org> * demos/gtk-demo/iconview_edit.c: remove unused variable.
This commit is contained in:
parent
ae61f443f3
commit
4561b2b872
@ -1,3 +1,7 @@
|
||||
2005-07-13 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* demos/gtk-demo/iconview_edit.c: remove unused variable.
|
||||
|
||||
2005-07-13 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gtk/gtktreemodel.[ch] (gtk_tree_row_reference_get_model): new
|
||||
|
@ -1,3 +1,7 @@
|
||||
2005-07-13 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* demos/gtk-demo/iconview_edit.c: remove unused variable.
|
||||
|
||||
2005-07-13 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gtk/gtktreemodel.[ch] (gtk_tree_row_reference_get_model): new
|
||||
|
@ -1,3 +1,7 @@
|
||||
2005-07-13 Manish Singh <yosh@gimp.org>
|
||||
|
||||
* demos/gtk-demo/iconview_edit.c: remove unused variable.
|
||||
|
||||
2005-07-13 Kristian Rietveld <kris@gtk.org>
|
||||
|
||||
* gtk/gtktreemodel.[ch] (gtk_tree_row_reference_get_model): new
|
||||
|
@ -24,10 +24,10 @@ fill_store (GtkListStore *store)
|
||||
GtkTreeIter iter;
|
||||
const gchar *text[] = { "Red", "Green", "Blue", "Yellow" };
|
||||
gint i;
|
||||
|
||||
|
||||
/* First clear the store */
|
||||
gtk_list_store_clear (store);
|
||||
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
gtk_list_store_append (store, &iter);
|
||||
@ -41,11 +41,11 @@ create_store (void)
|
||||
GtkListStore *store;
|
||||
|
||||
store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING);
|
||||
|
||||
|
||||
return store;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
set_cell_color (GtkCellLayout *cell_layout,
|
||||
GtkCellRenderer *cell,
|
||||
GtkTreeModel *tree_model,
|
||||
@ -59,14 +59,14 @@ set_cell_color (GtkCellLayout *cell_layout,
|
||||
|
||||
gtk_tree_model_get (tree_model, iter, COL_TEXT, &text, -1);
|
||||
if (gdk_color_parse (text, &color))
|
||||
pixel =
|
||||
pixel =
|
||||
(color.red >> 8) << 24 |
|
||||
(color.green >> 8) << 16 |
|
||||
(color.blue >> 8) << 8;
|
||||
|
||||
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, 24, 24);
|
||||
gdk_pixbuf_fill (pixbuf, pixel);
|
||||
|
||||
|
||||
g_object_set (cell, "pixbuf", pixbuf, NULL);
|
||||
|
||||
g_object_unref (pixbuf);
|
||||
@ -86,7 +86,7 @@ edited (GtkCellRendererText *cell,
|
||||
path = gtk_tree_path_new_from_string (path_string);
|
||||
|
||||
gtk_tree_model_get_iter (model, &iter, path);
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
|
||||
gtk_list_store_set (GTK_LIST_STORE (model), &iter,
|
||||
COL_TEXT, text, -1);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
@ -100,10 +100,9 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
GtkWidget *icon_view;
|
||||
GtkListStore *store;
|
||||
GtkCellRenderer *renderer;
|
||||
GError *error;
|
||||
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
|
||||
|
||||
gtk_window_set_screen (GTK_WINDOW (window),
|
||||
gtk_widget_get_screen (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Editing and Drag-and-Drop");
|
||||
@ -113,7 +112,7 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
|
||||
store = create_store ();
|
||||
fill_store (store);
|
||||
|
||||
|
||||
icon_view = gtk_icon_view_new_with_model (GTK_TREE_MODEL (store));
|
||||
g_object_unref (store);
|
||||
|
||||
@ -123,12 +122,12 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_icon_view_set_columns (GTK_ICON_VIEW (icon_view), 2);
|
||||
gtk_icon_view_set_reorderable (GTK_ICON_VIEW (icon_view), TRUE);
|
||||
|
||||
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (icon_view),
|
||||
renderer, TRUE);
|
||||
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (icon_view),
|
||||
renderer,
|
||||
renderer,
|
||||
set_cell_color,
|
||||
NULL, NULL);
|
||||
|
||||
@ -138,13 +137,13 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
g_object_set (renderer, "editable", TRUE, NULL);
|
||||
g_signal_connect (renderer, "edited", G_CALLBACK (edited), icon_view);
|
||||
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_view),
|
||||
renderer,
|
||||
renderer,
|
||||
"text", COL_TEXT,
|
||||
NULL);
|
||||
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), icon_view);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!GTK_WIDGET_VISIBLE (window))
|
||||
gtk_widget_show_all (window);
|
||||
else
|
||||
@ -152,7 +151,7 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
gtk_widget_destroy (window);
|
||||
window = NULL;
|
||||
}
|
||||
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user