Commit 85267e92 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

don't draw if label->layout is NULL due to a pending resize

2001-01-09  Havoc Pennington  <hp@redhat.com>

	* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
	is NULL due to a pending resize

	* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
	column width to values less than 1

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
	width to be between min/max width, and still set the width
	even if autosize is turned on, so the tree view can use this
	function in order to autosize.
	(gtk_tree_view_column_init): set initial width to 1 not 0

	* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
	setter function to modify column width, so we get notification
	(gtk_tree_view_insert_iter_height): ditto
	(gtk_tree_view_calc_size): ditto
	(gtk_tree_view_check_dirty): ditto

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
	properties to change all the interesting attributes of the tree
	view column.
	(gtk_tree_view_column_set_header_clickable): rename set_clickable
	(gtk_tree_view_column_get_clickable): add
	(gtk_tree_view_column_set_cell_renderer): don't unset the current
	attributes; assume a cell renderer with equivalent object
	properties has been swapped in. Do g_object_notify().
	(gtk_tree_view_column_set_visible): g_object_notify
	(gtk_tree_view_column_get_sizing): rename from get_col_type
	(gtk_tree_view_column_set_sizing): g_object_notify
	(gtk_tree_view_column_set_width): add g_object_notify
	(gtk_tree_view_column_set_min_width): ditto
	(gtk_tree_view_column_set_max_width): ditto
	(gtk_tree_view_column_set_title): ditto
	(gtk_tree_view_column_set_clickable): ditto
	(gtk_tree_view_column_set_widget): ditto
	(gtk_tree_view_column_set_justification): ditto
parent 637c61da
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtklabel.c (gtk_label_expose): don't draw if label->layout
is NULL due to a pending resize
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): don't set the
column width to values less than 1
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_width): clamp
width to be between min/max width, and still set the width
even if autosize is turned on, so the tree view can use this
function in order to autosize.
(gtk_tree_view_column_init): set initial width to 1 not 0
* gtk/gtktreeview.c (gtk_tree_view_size_request_buttons): use
setter function to modify column width, so we get notification
(gtk_tree_view_insert_iter_height): ditto
(gtk_tree_view_calc_size): ditto
(gtk_tree_view_check_dirty): ditto
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_class_init): Add
properties to change all the interesting attributes of the tree
view column.
(gtk_tree_view_column_set_header_clickable): rename set_clickable
(gtk_tree_view_column_get_clickable): add
(gtk_tree_view_column_set_cell_renderer): don't unset the current
attributes; assume a cell renderer with equivalent object
properties has been swapped in. Do g_object_notify().
(gtk_tree_view_column_set_visible): g_object_notify
(gtk_tree_view_column_get_sizing): rename from get_col_type
(gtk_tree_view_column_set_sizing): g_object_notify
(gtk_tree_view_column_set_width): add g_object_notify
(gtk_tree_view_column_set_min_width): ditto
(gtk_tree_view_column_set_max_width): ditto
(gtk_tree_view_column_set_title): ditto
(gtk_tree_view_column_set_clickable): ditto
(gtk_tree_view_column_set_widget): ditto
(gtk_tree_view_column_set_justification): ditto
2001-01-09 Havoc Pennington <hp@redhat.com> 2001-01-09 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where * gtk/gtktreeview.c (gtk_tree_view_check_dirty): handle case where
......
...@@ -711,9 +711,13 @@ gtk_label_expose (GtkWidget *widget, ...@@ -711,9 +711,13 @@ gtk_label_expose (GtkWidget *widget,
g_return_val_if_fail (event != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE);
label = GTK_LABEL (widget); label = GTK_LABEL (widget);
/* if label->layout is NULL it means we got a set_text since
* our last size request, so a resize should be queued,
* which means a full expose is in the queue anyway.
*/
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget) && if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_MAPPED (widget) &&
label->label && (*label->label != '\0')) label->layout && label->label && (*label->label != '\0'))
{ {
misc = GTK_MISC (widget); misc = GTK_MISC (widget);
......
...@@ -520,7 +520,8 @@ gtk_tree_view_size_request_buttons (GtkTreeView *tree_view) ...@@ -520,7 +520,8 @@ gtk_tree_view_size_request_buttons (GtkTreeView *tree_view)
gtk_widget_size_request (column->button, &requisition); gtk_widget_size_request (column->button, &requisition);
column->width = MAX (column->width, requisition.width); gtk_tree_view_column_set_width (column,
MAX (column->width, requisition.width));
tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height); tree_view->priv->header_height = MAX (tree_view->priv->header_height, requisition.height);
} }
} }
...@@ -2215,9 +2216,11 @@ gtk_tree_view_insert_iter_height (GtkTreeView *tree_view, ...@@ -2215,9 +2216,11 @@ gtk_tree_view_insert_iter_height (GtkTreeView *tree_view,
max_height = MAX (max_height, TREE_VIEW_VERTICAL_SEPARATOR + height); max_height = MAX (max_height, TREE_VIEW_VERTICAL_SEPARATOR + height);
if (first == TRUE && TREE_VIEW_DRAW_EXPANDERS (tree_view)) if (first == TRUE && TREE_VIEW_DRAW_EXPANDERS (tree_view))
column->width = MAX (column->width, depth * tree_view->priv->tab_offset + width); gtk_tree_view_column_set_width (column,
MAX (column->width, depth * tree_view->priv->tab_offset + width));
else else
column->width = MAX (column->width, width); gtk_tree_view_column_set_width (column,
MAX (column->width, width));
first = FALSE; first = FALSE;
} }
...@@ -2311,9 +2314,10 @@ gtk_tree_view_calc_size (GtkTreeView *tree_view, ...@@ -2311,9 +2314,10 @@ gtk_tree_view_calc_size (GtkTreeView *tree_view,
continue; continue;
if (i == 0 && TREE_VIEW_DRAW_EXPANDERS (tree_view)) if (i == 0 && TREE_VIEW_DRAW_EXPANDERS (tree_view))
column->width = MAX (column->width, depth * tree_view->priv->tab_offset + width); gtk_tree_view_column_set_width (column,
MAX (column->width, depth * tree_view->priv->tab_offset + width));
else else
column->width = MAX (column->width, width); gtk_tree_view_column_set_width (column, MAX (column->width, width));
} }
_gtk_rbtree_node_set_height (tree, temp, max_height); _gtk_rbtree_node_set_height (tree, temp, max_height);
if (temp->children != NULL && if (temp->children != NULL &&
...@@ -2445,7 +2449,7 @@ gtk_tree_view_check_dirty (GtkTreeView *tree_view) ...@@ -2445,7 +2449,7 @@ gtk_tree_view_check_dirty (GtkTreeView *tree_view)
dirty = TRUE; dirty = TRUE;
if (column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE) if (column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
{ {
column->width = column->button->requisition.width; gtk_tree_view_column_set_width (column, MAX (column->button->requisition.width, 1));
} }
} }
} }
...@@ -3279,9 +3283,6 @@ gtk_tree_view_columns_autosize (GtkTreeView *tree_view) ...@@ -3279,9 +3283,6 @@ gtk_tree_view_columns_autosize (GtkTreeView *tree_view)
gtk_widget_queue_resize (GTK_WIDGET (tree_view)); gtk_widget_queue_resize (GTK_WIDGET (tree_view));
} }
/* FIXME let's rename this to be "interactive" or something,
* "active" is confusing since it also is a widget state
*/
/** /**
* gtk_tree_view_set_headers_clickable: * gtk_tree_view_set_headers_clickable:
* @tree_view: A #GtkTreeView. * @tree_view: A #GtkTreeView.
...@@ -3300,7 +3301,7 @@ gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view, ...@@ -3300,7 +3301,7 @@ gtk_tree_view_set_headers_clickable (GtkTreeView *tree_view,
g_return_if_fail (tree_view->priv->model != NULL); g_return_if_fail (tree_view->priv->model != NULL);
for (list = tree_view->priv->columns; list; list = list->next) for (list = tree_view->priv->columns; list; list = list->next)
gtk_tree_view_column_set_header_clickable (GTK_TREE_VIEW_COLUMN (list->data), setting); gtk_tree_view_column_set_clickable (GTK_TREE_VIEW_COLUMN (list->data), setting);
} }
/** /**
......
...@@ -23,8 +23,26 @@ ...@@ -23,8 +23,26 @@
#include "gtkbutton.h" #include "gtkbutton.h"
#include "gtkalignment.h" #include "gtkalignment.h"
#include "gtklabel.h" #include "gtklabel.h"
#include "gtkintl.h"
enum { enum
{
PROP_0,
PROP_CELL_RENDERER,
PROP_VISIBLE,
PROP_SIZING,
PROP_WIDTH,
PROP_MIN_WIDTH,
PROP_MAX_WIDTH,
PROP_TITLE,
PROP_CLICKABLE,
PROP_WIDGET,
PROP_JUSTIFICATION
};
enum
{
CLICKED, CLICKED,
LAST_SIGNAL LAST_SIGNAL
}; };
...@@ -35,6 +53,17 @@ static void gtk_tree_view_column_class_init (GtkTreeViewColumnClass *klass) ...@@ -35,6 +53,17 @@ static void gtk_tree_view_column_class_init (GtkTreeViewColumnClass *klass)
static void gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column, static void gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
va_list args); va_list args);
static void gtk_real_tree_column_clicked (GtkTreeViewColumn *tree_column); static void gtk_real_tree_column_clicked (GtkTreeViewColumn *tree_column);
static void gtk_tree_view_column_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec,
const gchar *trailer);
static void gtk_tree_view_column_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec,
const gchar *trailer);
static GtkObjectClass *parent_class = NULL; static GtkObjectClass *parent_class = NULL;
...@@ -70,21 +99,114 @@ gtk_tree_view_column_get_type (void) ...@@ -70,21 +99,114 @@ gtk_tree_view_column_get_type (void)
static void static void
gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class) gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
{ {
GtkObjectClass *object_class; GObjectClass *object_class;
object_class = (GtkObjectClass*) class; object_class = (GObjectClass*) class;
parent_class = g_type_class_peek_parent (class); parent_class = g_type_class_peek_parent (class);
class->clicked = gtk_real_tree_column_clicked; class->clicked = gtk_real_tree_column_clicked;
object_class->set_property = gtk_tree_view_column_set_property;
object_class->get_property = gtk_tree_view_column_get_property;
tree_column_signals[CLICKED] = tree_column_signals[CLICKED] =
gtk_signal_new ("clicked", g_signal_newc ("clicked",
GTK_RUN_FIRST, GTK_CLASS_TYPE (object_class),
GTK_CLASS_TYPE (object_class), G_SIGNAL_RUN_LAST,
GTK_SIGNAL_OFFSET (GtkTreeViewColumnClass, clicked), G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked),
gtk_marshal_VOID__VOID, NULL,
GTK_TYPE_NONE, 0); gtk_marshal_VOID__VOID,
GTK_TYPE_NONE, 0);
g_object_class_install_property (object_class,
PROP_CELL_RENDERER,
g_param_spec_object ("cell_renderer",
_("Cell renderer"),
_("Cell renderer object to use for rendering the cell"),
GTK_TYPE_CELL_RENDERER,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_VISIBLE,
g_param_spec_boolean ("visible",
_("Visible"),
_("Whether to display the colomn"),
TRUE,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_SIZING,
g_param_spec_enum ("sizing",
_("Sizing"),
_("Resize mode of the column"),
GTK_TYPE_TREE_VIEW_COLUMN_SIZING,
GTK_TREE_VIEW_COLUMN_AUTOSIZE,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_WIDTH,
g_param_spec_int ("width",
_("Width"),
_("Current width of the column"),
1,
G_MAXINT,
1, /* not useful */
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_MIN_WIDTH,
g_param_spec_int ("min_width",
_("Minimum Width"),
_("Minimum allowed width of the column"),
-1,
G_MAXINT,
1,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_MAX_WIDTH,
g_param_spec_int ("max_width",
_("Maximum Width"),
_("Maximum allowed width of the column"),
-1,
G_MAXINT,
G_MAXINT,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_TITLE,
g_param_spec_string ("title",
_("Title"),
_("Title to appear in column header"),
"",
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_CLICKABLE,
g_param_spec_boolean ("clickable",
_("Clickable"),
_("Whether the header can be clicked"),
TRUE,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_WIDGET,
g_param_spec_object ("widget",
_("Widget"),
_("Widget to put in column header button instead of column title"),
GTK_TYPE_WIDGET,
G_PARAM_READABLE | G_PARAM_WRITABLE));
g_object_class_install_property (object_class,
PROP_JUSTIFICATION,
g_param_spec_enum ("justification",
_("Justification"),
_("Justification of the column"),
GTK_TYPE_JUSTIFICATION,
GTK_JUSTIFY_LEFT,
G_PARAM_READABLE | G_PARAM_WRITABLE));
} }
static void static void
...@@ -92,7 +214,7 @@ gtk_tree_view_column_init (GtkTreeViewColumn *tree_column) ...@@ -92,7 +214,7 @@ gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
{ {
tree_column->button = NULL; tree_column->button = NULL;
tree_column->justification = GTK_JUSTIFY_LEFT; tree_column->justification = GTK_JUSTIFY_LEFT;
tree_column->width = 0; tree_column->width = 1;
tree_column->min_width = -1; tree_column->min_width = -1;
tree_column->max_width = -1; tree_column->max_width = -1;
tree_column->cell = NULL; tree_column->cell = NULL;
...@@ -103,6 +225,136 @@ gtk_tree_view_column_init (GtkTreeViewColumn *tree_column) ...@@ -103,6 +225,136 @@ gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
tree_column->dirty = TRUE; tree_column->dirty = TRUE;
} }