#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtktypebuiltins.h"
+#include "a11y/gtktreeviewaccessible.h"
/**
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
GtkTreeViewColumnPrivate *priv = tree_column->priv;
+ /* Remove this column from its treeview,
+ * in case this column is destroyed before its treeview.
+ */
+ if (priv->tree_view)
+ gtk_tree_view_remove_column (GTK_TREE_VIEW (priv->tree_view), tree_column);
+
if (priv->cell_area_context)
{
g_signal_handler_disconnect (priv->cell_area_context,
((GdkEventButton *)event)->button == 1)
{
priv->maybe_reordered = TRUE;
- gdk_window_get_pointer (gtk_button_get_event_window (GTK_BUTTON (widget)),
- &priv->drag_x,
- &priv->drag_y,
- NULL);
+ gdk_window_get_device_position (gtk_button_get_event_window (GTK_BUTTON (widget)),
+ gdk_event_get_device (event),
+ &priv->drag_x,
+ &priv->drag_y,
+ NULL);
gtk_widget_grab_focus (widget);
}
/**
* gtk_tree_view_column_new_with_attributes:
- * @title: The title to set the header to.
- * @cell: The #GtkCellRenderer.
- * @Varargs: A %NULL-terminated list of attributes.
- *
- * Creates a new #GtkTreeViewColumn with a number of default values. This is
- * equivalent to calling gtk_tree_view_column_set_title(),
+ * @title: The title to set the header to
+ * @cell: The #GtkCellRenderer
+ * @...: A %NULL-terminated list of attributes
+ *
+ * Creates a new #GtkTreeViewColumn with a number of default values.
+ * This is equivalent to calling gtk_tree_view_column_set_title(),
* gtk_tree_view_column_pack_start(), and
* gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
*
/**
* gtk_tree_view_column_set_attributes:
- * @tree_column: A #GtkTreeViewColumn.
+ * @tree_column: A #GtkTreeViewColumn
* @cell_renderer: the #GtkCellRenderer we're setting the attributes of
- * @Varargs: A %NULL-terminated list of attributes.
- *
+ * @...: A %NULL-terminated list of attributes
+ *
* Sets the attributes in the list as the attributes of @tree_column.
* The attributes should be in attribute/column order, as in
* gtk_tree_view_column_add_attribute(). All existing attributes
* are removed, and replaced with the new attributes.
- **/
+ */
void
gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell_renderer,
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
if (priv->tree_view)
- _gtk_tree_view_reset_header_styles (GTK_TREE_VIEW (priv->tree_view));
+ {
+ _gtk_tree_view_reset_header_styles (GTK_TREE_VIEW (priv->tree_view));
+ _gtk_tree_view_accessible_toggle_visibility (GTK_TREE_VIEW (priv->tree_view),
+ tree_column);
+ }
gtk_tree_view_column_update_button (tree_column);
g_object_notify (G_OBJECT (tree_column), "visible");
int width)
{
GtkTreeViewColumnPrivate *priv;
- GtkAllocation allocation;
gboolean rtl;
+ GtkAllocation allocation = { 0, 0, 0, 0 };
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
&allocation);
if (x_offset)
- {
- GdkRectangle button_allocation;
+ *x_offset = allocation.x - cell_area.x;
- /* Retrieve column offset */
- gtk_widget_get_allocation (priv->button, &button_allocation);
- *x_offset = allocation.x - button_allocation.x;
- }
if (width)
*width = allocation.width;