diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-02-12 08:27:22 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-02-12 08:27:22 +0800 |
commit | 04bb0a4fb01448394533a80850370448a2f3aadf (patch) | |
tree | 847a8b541f2597a80e2bfdc73b3401a288368128 /widgets/e-table/e-table-col.c | |
parent | 07d9ddab8e2b6759bbe1b2364371bf5c7b6fe6de (diff) | |
download | gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.tar gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.tar.gz gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.tar.bz2 gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.tar.lz gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.tar.xz gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.tar.zst gsoc2013-evolution-04bb0a4fb01448394533a80850370448a2f3aadf.zip |
Test column header image.
2000-02-11 Christopher James Lahey <clahey@helixcode.com>
* clip.png: Test column header image.
* test-check.c: Test pixbuf column headers.
* e-table-col.h, e-table-col.c: Added pixbufs for column headers.
* e-table-header-item.c (draw_button): Draw pixbuf column headers properly.
svn path=/trunk/; revision=1739
Diffstat (limited to 'widgets/e-table/e-table-col.c')
-rw-r--r-- | widgets/e-table/e-table-col.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/widgets/e-table/e-table-col.c b/widgets/e-table/e-table-col.c index 6f475158a5..ba5c131078 100644 --- a/widgets/e-table/e-table-col.c +++ b/widgets/e-table/e-table-col.c @@ -21,7 +21,10 @@ etc_destroy (GtkObject *object) { ETableCol *etc = E_TABLE_COL (object); - g_free (etc->text); + if ( etc->is_pixbuf ) + gdk_pixbuf_unref( etc->pixbuf ); + else + g_free (etc->text); (*parent_class->destroy)(object); } @@ -47,9 +50,12 @@ e_table_col_new (int col_idx, const char *text, int width, int min_width, g_return_val_if_fail (compare != NULL, NULL); etc = gtk_type_new (E_TABLE_COL_TYPE); + + etc->is_pixbuf = FALSE; etc->col_idx = col_idx; etc->text = g_strdup (text); + etc->pixbuf = NULL; etc->width = width; etc->min_width = min_width; etc->ecell = ecell; @@ -61,4 +67,35 @@ e_table_col_new (int col_idx, const char *text, int width, int min_width, return etc; } +ETableCol * +e_table_col_new_with_pixbuf (int col_idx, GdkPixbuf *pixbuf, int width, int min_width, + ECell *ecell, GCompareFunc compare, gboolean resizable) +{ + ETableCol *etc; + + g_return_val_if_fail (width >= 0, NULL); + g_return_val_if_fail (min_width >= 0, NULL); + g_return_val_if_fail (width >= min_width, NULL); + g_return_val_if_fail (compare != NULL, NULL); + + etc = gtk_type_new (E_TABLE_COL_TYPE); + + etc->is_pixbuf = TRUE; + + etc->col_idx = col_idx; + etc->text = NULL; + etc->pixbuf = pixbuf; + etc->width = width; + etc->min_width = min_width; + etc->ecell = ecell; + etc->compare = compare; + + etc->selected = 0; + etc->resizeable = resizable; + + gdk_pixbuf_ref(etc->pixbuf); + + return etc; +} + |