Re: [gnome-db] Patch for GnomeDBGrid
- From: Stephane Wirtel <stephane wirtel brutele be>
- To: Rodrigo Moya <rodrigo ximian com>
- Cc: stephane wirtel belgacom net, gnome-db <gnome-db-list gnome org>
- Subject: Re: [gnome-db] Patch for GnomeDBGrid
- Date: Wed, 17 Dec 2003 15:25:13 +0100
>> so, please, could you resend it? Make sure you just run:
no problem, so i did not read the HACKING file.
>>
>> cvs -z3 diff -u > /tmp/libgnomedb.diff
>>
>> thanks for the patch
i resend you the patch with some changes, and with "cvs -z3 diff -u > ..."
---end quoted text---
Index: libgnomedb/gnome-db-grid.c
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-grid.c,v
retrieving revision 1.49
diff -u -r1.49 gnome-db-grid.c
--- libgnomedb/gnome-db-grid.c 11 Dec 2003 15:34:05 -0000 1.49
+++ libgnomedb/gnome-db-grid.c 17 Dec 2003 14:20:33 -0000
@@ -719,6 +719,57 @@
}
/**
+ * gnome_db_grid_set_column_title
+ * @grid a #GnomeDbGrid widget
+ * @col the number of the column to change the title
+ * @title the new title for this column
+ *
+ * Sets the title for a column
+ */
+void
+gnome_db_grid_set_column_title(GnomeDbGrid *grid, gint col, const gchar *title)
+{
+ GtkTreeViewColumn *column = NULL;
+ gint number_columns;
+ GList *list = NULL;
+ g_return_if_fail (GNOME_DB_IS_GRID (grid));
+ g_return_if_fail (title != NULL);
+
+ list = gtk_tree_view_get_columns (GTK_TREE_VIEW (grid->priv->tree_view));
+ g_return_if_fail (list != NULL);
+
+ if (list != NULL) {
+ number_columns = g_list_length (list);
+ if (col >= 0 && col < number_columns) {
+ column = gtk_tree_view_get_column ( GTK_TREE_VIEW(grid->priv->tree_view), col);
+ gtk_tree_view_column_set_title (column, title);
+ }
+ }
+
+}
+
+/**
+ * gnome_db_grid_get_column_title
+ * @grid a #GnomeDbGrid widget
+ * @col the number of the column to get the title
+ *
+ * Get the title of a column
+ * Returns: the title of a column.
+ */
+const gchar *
+gnome_db_grid_get_column_title(GnomeDbGrid *grid, gint col)
+{
+ GtkTreeViewColumn *column = NULL;
+ gchar *title = NULL;
+
+ g_return_val_if_fail (GNOME_DB_IS_GRID (grid), NULL);
+ column = gtk_tree_view_get_column (GTK_TREE_VIEW (grid->priv->tree_view), col);
+ title = gtk_tree_view_column_get_title (column);
+ return title;
+}
+
+
+/**
* gnome_db_grid_get_show_title
* @grid: a #GnomeDbGrid widget.
*
Index: libgnomedb/gnome-db-grid.h
===================================================================
RCS file: /cvs/gnome/libgnomedb/libgnomedb/gnome-db-grid.h,v
retrieving revision 1.17
diff -u -r1.17 gnome-db-grid.h
--- libgnomedb/gnome-db-grid.h 11 Dec 2003 15:34:05 -0000 1.17
+++ libgnomedb/gnome-db-grid.h 17 Dec 2003 14:20:33 -0000
@@ -61,6 +61,8 @@
const gchar *gnome_db_grid_get_title (GnomeDbGrid *grid);
void gnome_db_grid_set_title (GnomeDbGrid *grid, const gchar *title);
+void gnome_db_grid_set_column_title (GnomeDbGrid *grid, gint col, const gchar *title);
+const gchar *gnome_db_grid_get_column_title (GnomeDbGrid *grid, gint col);
gboolean gnome_db_grid_get_show_title (GnomeDbGrid *grid);
void gnome_db_grid_set_show_title (GnomeDbGrid *grid, gboolean show);
void gnome_db_grid_set_title_icon_from_file (GnomeDbGrid *grid, const gchar *file);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]