2000-10-05 01:04:57 +00:00
|
|
|
/* gtktreeviewcolumn.c
|
|
|
|
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
2012-02-27 13:01:10 +00:00
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2000-10-05 01:04:57 +00:00
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2010-09-13 00:50:04 +00:00
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtktreeviewcolumn.h"
|
2010-09-13 00:50:04 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
#include "gtktreeview.h"
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtktreeprivate.h"
|
2003-07-11 12:51:24 +00:00
|
|
|
#include "gtkcelllayout.h"
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtkbutton.h"
|
|
|
|
#include "gtkalignment.h"
|
2000-10-16 17:50:15 +00:00
|
|
|
#include "gtklabel.h"
|
2011-08-28 05:54:55 +00:00
|
|
|
#include "gtkbox.h"
|
2001-11-17 23:28:51 +00:00
|
|
|
#include "gtkmarshalers.h"
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
#include "gtkarrow.h"
|
2010-11-28 18:01:49 +00:00
|
|
|
#include "gtkcellareacontext.h"
|
|
|
|
#include "gtkcellareabox.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2001-01-09 23:24:20 +00:00
|
|
|
#include "gtkintl.h"
|
2011-01-04 19:51:19 +00:00
|
|
|
#include "gtktypebuiltins.h"
|
2011-11-16 02:47:33 +00:00
|
|
|
#include "a11y/gtktreeviewaccessible.h"
|
2010-07-09 17:22:23 +00:00
|
|
|
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2010-10-22 19:59:08 +00:00
|
|
|
/**
|
|
|
|
* SECTION:gtktreeviewcolumn
|
|
|
|
* @Short_description: A visible column in a GtkTreeView widget
|
|
|
|
* @Title: GtkTreeViewColumn
|
|
|
|
* @See_also: #GtkTreeView, #GtkTreeSelection, #GtkTreeDnd, #GtkTreeMode, #GtkTreeSortable,
|
|
|
|
* #GtkTreeModelSort, #GtkListStore, #GtkTreeStore, #GtkCellRenderer, #GtkCellEditable,
|
|
|
|
* #GtkCellRendererPixbuf, #GtkCellRendererText, #GtkCellRendererToggle
|
|
|
|
*
|
|
|
|
* The GtkTreeViewColumn object represents a visible column in a #GtkTreeView widget.
|
|
|
|
* It allows to set properties of the column header, and functions as a holding pen for
|
|
|
|
* the cell renderers which determine how the data in the column is displayed.
|
|
|
|
*
|
|
|
|
* Please refer to the <link linkend="TreeWidget">tree widget conceptual overview</link>
|
|
|
|
* for an overview of all the objects and data types related to the tree widget and how
|
|
|
|
* they work together.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Type methods */
|
2003-07-11 12:51:24 +00:00
|
|
|
static void gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* GObject methods */
|
|
|
|
static void gtk_tree_view_column_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_tree_view_column_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec);
|
|
|
|
static void gtk_tree_view_column_finalize (GObject *object);
|
2010-11-29 04:01:49 +00:00
|
|
|
static void gtk_tree_view_column_dispose (GObject *object);
|
2010-12-01 14:26:25 +00:00
|
|
|
static GObject *gtk_tree_view_column_constructor (GType type,
|
|
|
|
guint n_construct_properties,
|
|
|
|
GObjectConstructParam *construct_properties);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
/* GtkCellLayout implementation */
|
2011-01-31 22:34:37 +00:00
|
|
|
static void gtk_tree_view_column_ensure_cell_area (GtkTreeViewColumn *column,
|
|
|
|
GtkCellArea *cell_area);
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
static GtkCellArea *gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout);
|
2003-07-11 12:51:24 +00:00
|
|
|
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
/* Button handling code */
|
2001-05-16 00:23:30 +00:00
|
|
|
static void gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column);
|
|
|
|
static void gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column);
|
|
|
|
|
|
|
|
/* Button signal handlers */
|
2001-05-22 19:18:47 +00:00
|
|
|
static gint gtk_tree_view_column_button_event (GtkWidget *widget,
|
2001-05-16 00:23:30 +00:00
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_tree_view_column_button_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2002-02-19 21:16:49 +00:00
|
|
|
static gboolean gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
|
|
|
|
gboolean group_cycling,
|
|
|
|
gpointer data);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* Property handlers */
|
|
|
|
static void gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
|
|
|
GtkTreeViewColumn *tree_column);
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
/* GtkCellArea/GtkCellAreaContext callbacks */
|
|
|
|
static void gtk_tree_view_column_context_changed (GtkCellAreaContext *context,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkTreeViewColumn *tree_column);
|
|
|
|
static void gtk_tree_view_column_add_editable_callback (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
const gchar *path_string,
|
|
|
|
gpointer user_data);
|
|
|
|
static void gtk_tree_view_column_remove_editable_callback (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
gpointer user_data);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Internal functions */
|
|
|
|
static void gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column);
|
|
|
|
static void gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-05-16 00:23:30 +00:00
|
|
|
va_list args);
|
2010-11-28 18:01:49 +00:00
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
/* GtkBuildable implementation */
|
|
|
|
static void gtk_tree_view_column_buildable_init (GtkBuildableIface *iface);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
|
|
struct _GtkTreeViewColumnPrivate
|
|
|
|
{
|
|
|
|
GtkWidget *tree_view;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *child;
|
|
|
|
GtkWidget *arrow;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GdkWindow *window;
|
|
|
|
gfloat xalign;
|
|
|
|
gulong property_changed_signal;
|
|
|
|
|
|
|
|
/* Sizing fields */
|
|
|
|
/* see gtk+/doc/tree-column-sizing.txt for more information on them */
|
|
|
|
GtkTreeViewColumnSizing column_type;
|
2010-12-06 07:31:07 +00:00
|
|
|
gint padding;
|
2010-11-30 05:29:45 +00:00
|
|
|
gint resized_width;
|
2011-06-10 04:09:25 +00:00
|
|
|
gint x_offset;
|
2010-11-30 05:29:45 +00:00
|
|
|
gint width;
|
|
|
|
gint fixed_width;
|
|
|
|
gint min_width;
|
|
|
|
gint max_width;
|
|
|
|
|
|
|
|
/* dragging columns */
|
|
|
|
gint drag_x;
|
|
|
|
gint drag_y;
|
|
|
|
|
|
|
|
gchar *title;
|
|
|
|
|
|
|
|
/* Sorting */
|
|
|
|
gulong sort_clicked_signal;
|
|
|
|
gulong sort_column_changed_signal;
|
|
|
|
gint sort_column_id;
|
|
|
|
GtkSortType sort_order;
|
|
|
|
|
|
|
|
/* Cell area */
|
|
|
|
GtkCellArea *cell_area;
|
|
|
|
GtkCellAreaContext *cell_area_context;
|
|
|
|
gulong add_editable_signal;
|
|
|
|
gulong remove_editable_signal;
|
|
|
|
gulong context_changed_signal;
|
|
|
|
|
|
|
|
/* Flags */
|
|
|
|
guint visible : 1;
|
|
|
|
guint resizable : 1;
|
|
|
|
guint clickable : 1;
|
|
|
|
guint dirty : 1;
|
|
|
|
guint show_sort_indicator : 1;
|
|
|
|
guint maybe_reordered : 1;
|
|
|
|
guint reorderable : 1;
|
|
|
|
guint use_resized_width : 1;
|
|
|
|
guint expand : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_VISIBLE,
|
|
|
|
PROP_RESIZABLE,
|
2011-06-10 04:09:25 +00:00
|
|
|
PROP_X_OFFSET,
|
2010-11-30 05:29:45 +00:00
|
|
|
PROP_WIDTH,
|
|
|
|
PROP_SPACING,
|
|
|
|
PROP_SIZING,
|
|
|
|
PROP_FIXED_WIDTH,
|
|
|
|
PROP_MIN_WIDTH,
|
|
|
|
PROP_MAX_WIDTH,
|
|
|
|
PROP_TITLE,
|
|
|
|
PROP_EXPAND,
|
|
|
|
PROP_CLICKABLE,
|
|
|
|
PROP_WIDGET,
|
|
|
|
PROP_ALIGNMENT,
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
PROP_SORT_INDICATOR,
|
|
|
|
PROP_SORT_ORDER,
|
2010-12-01 14:26:25 +00:00
|
|
|
PROP_SORT_COLUMN_ID,
|
|
|
|
PROP_CELL_AREA
|
2010-11-30 05:29:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
CLICKED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
static guint tree_column_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2010-09-18 23:57:32 +00:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GtkTreeViewColumn, gtk_tree_view_column, G_TYPE_INITIALLY_UNOWNED,
|
2006-05-02 23:56:43 +00:00
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_LAYOUT,
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
gtk_tree_view_column_cell_layout_init)
|
|
|
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
|
|
|
gtk_tree_view_column_buildable_init))
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_class_init (GtkTreeViewColumnClass *class)
|
|
|
|
{
|
2001-01-09 23:24:20 +00:00
|
|
|
GObjectClass *object_class;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
object_class = (GObjectClass*) class;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
class->clicked = NULL;
|
doh, this was broken beyond believe.
Tue Dec 12 23:46:44 2000 Tim Janik <timj@gtk.org>
* gtk/stock-icons/Makefile.am: doh, this was broken beyond believe.
* gtk/gtkbox.c: change property types from (u)long to (u)int for
::position and ::padding.
* gtk/gtkcontainer.c: make ::border_width an INT property.
* gtk/gtkpacker.c: make ::position an INT property.
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_adjustment_changed):
guard against NULL h/v scrollbars, since this is used at construction
time.
* gtk/gtkclist.[hc]: nuked gtk_clist_construct(), implemented
internal gtk_clist_constructor().
* gtk/gtkctree.[hc]: nuked gtk_ctree_construct(), implemented
gtk_ctree_constructor().
* gtk/gtkprogressbar.c (gtk_progress_bar_class_init): property
::pulse_step should use ARG_PULSE_STEP, not ARG_FRACTION.
* docs/reference/Makefile.am: fun stuff, disabled docs generation
again, gtk-scan.c needs to introspec paramspecs, not GtkAgs.
* gtk/gtkwidget.[hc]:
removed gtk_widget_setv(), gtk_widget_getv(), gtk_widget_newv()
and gtk_widget_get().
(gtk_widget_new): use g_object_new_valist().
(gtk_widget_set): use g_object_set_valist().
* gtk/gtkobject.[hc]:
removed gtk_object_arg_get_info(), gtk_object_getv(),
gtk_object_query_args(), gtk_object_newv(),
gtk_object_class_add_signals(),
gtk_object_class_user_signal_new(),
gtk_object_class_user_signal_newv(),
gtk_object_arg_set(), gtk_object_arg_get(),
gtk_object_args_collect(),
gtk_object_default_construct(),
gtk_object_constructed(),
GTK_CONSTRUCTED and GTK_OBJECT_CONSTRUCTED().
removed nsignals, signals and n_args members from GtkObjectClass.
(gtk_object_new): use g_object_new_valist().
(gtk_object_set): use g_object_set_valist().
(gtk_object_get): use g_object_get_valist().
* gtk/gtkcompat.h: define gtk_object_default_construct().
* gtk/gtktypeutils.c (gtk_type_new): create constructed objects via
g_object_new().
* gtk/*.c: removed gtk_object_class_add_signals() from class_init()
fucntions, cleaned up method assignments (make sure your structures
are setup properly before calling out). removed all GTK_CONSTRUCTED
hacks ;)
2000-12-13 01:34:41 +00:00
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
object_class->constructor = gtk_tree_view_column_constructor;
|
2001-02-17 00:16:08 +00:00
|
|
|
object_class->finalize = gtk_tree_view_column_finalize;
|
2010-11-29 04:01:49 +00:00
|
|
|
object_class->dispose = gtk_tree_view_column_dispose;
|
2001-01-09 23:24:20 +00:00
|
|
|
object_class->set_property = gtk_tree_view_column_set_property;
|
|
|
|
object_class->get_property = gtk_tree_view_column_get_property;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column_signals[CLICKED] =
|
2005-09-01 05:11:46 +00:00
|
|
|
g_signal_new (I_("clicked"),
|
2002-10-13 19:34:42 +00:00
|
|
|
G_OBJECT_CLASS_TYPE (object_class),
|
2001-06-29 16:30:25 +00:00
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked),
|
|
|
|
NULL, NULL,
|
2001-11-17 23:28:51 +00:00
|
|
|
_gtk_marshal_VOID__VOID,
|
2002-10-13 19:34:42 +00:00
|
|
|
G_TYPE_NONE, 0);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_VISIBLE,
|
|
|
|
g_param_spec_boolean ("visible",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Visible"),
|
|
|
|
P_("Whether to display the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
TRUE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_RESIZABLE,
|
|
|
|
g_param_spec_boolean ("resizable",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Resizable"),
|
|
|
|
P_("Column is user-resizable"),
|
2001-11-19 21:18:22 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-11-19 21:18:22 +00:00
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_X_OFFSET,
|
|
|
|
g_param_spec_int ("x-offset",
|
|
|
|
P_("X position"),
|
|
|
|
P_("Current X position of the column"),
|
|
|
|
-G_MAXINT,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
|
|
|
GTK_PARAM_READABLE));
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDTH,
|
|
|
|
g_param_spec_int ("width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Width"),
|
|
|
|
P_("Current width of the column"),
|
2001-09-08 00:56:30 +00:00
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READABLE));
|
2004-07-15 17:37:06 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SPACING,
|
|
|
|
g_param_spec_int ("spacing",
|
|
|
|
P_("Spacing"),
|
|
|
|
P_("Space which is inserted between cells"),
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SIZING,
|
|
|
|
g_param_spec_enum ("sizing",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Sizing"),
|
|
|
|
P_("Resize mode of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
GTK_TYPE_TREE_VIEW_COLUMN_SIZING,
|
2004-07-15 17:37:06 +00:00
|
|
|
GTK_TREE_VIEW_COLUMN_GROW_ONLY,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
2001-09-08 00:56:30 +00:00
|
|
|
PROP_FIXED_WIDTH,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_int ("fixed-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Fixed Width"),
|
|
|
|
P_("Current fixed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
1,
|
|
|
|
G_MAXINT,
|
|
|
|
1, /* not useful */
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_MIN_WIDTH,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_int ("min-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Minimum Width"),
|
|
|
|
P_("Minimum allowed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
2001-09-08 00:56:30 +00:00
|
|
|
-1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_MAX_WIDTH,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_int ("max-width",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Maximum Width"),
|
|
|
|
P_("Maximum allowed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
2001-09-08 00:56:30 +00:00
|
|
|
-1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_TITLE,
|
|
|
|
g_param_spec_string ("title",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Title"),
|
|
|
|
P_("Title to appear in column header"),
|
2001-01-09 23:24:20 +00:00
|
|
|
"",
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_EXPAND,
|
|
|
|
g_param_spec_boolean ("expand",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Expand"),
|
|
|
|
P_("Column gets share of extra width allocated to the widget"),
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_CLICKABLE,
|
|
|
|
g_param_spec_boolean ("clickable",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Clickable"),
|
|
|
|
P_("Whether the header can be clicked"),
|
2004-07-15 17:37:06 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDGET,
|
|
|
|
g_param_spec_object ("widget",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Widget"),
|
|
|
|
P_("Widget to put in column header button instead of column title"),
|
2001-01-09 23:24:20 +00:00
|
|
|
GTK_TYPE_WIDGET,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
PROP_ALIGNMENT,
|
|
|
|
g_param_spec_float ("alignment",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Alignment"),
|
|
|
|
P_("X Alignment of the column header text or widget"),
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
0.0,
|
|
|
|
1.0,
|
2004-07-15 17:37:06 +00:00
|
|
|
0.0,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
g_param_spec_boolean ("reorderable",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Reorderable"),
|
|
|
|
P_("Whether the column can be reordered around the headers"),
|
2001-05-16 00:23:30 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_INDICATOR,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_boolean ("sort-indicator",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Sort indicator"),
|
|
|
|
P_("Whether to show a sort indicator"),
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_ORDER,
|
2005-03-09 04:04:40 +00:00
|
|
|
g_param_spec_enum ("sort-order",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Sort order"),
|
|
|
|
P_("Sort direction the sort indicator should indicate"),
|
2001-08-23 18:33:37 +00:00
|
|
|
GTK_TYPE_SORT_TYPE,
|
|
|
|
GTK_SORT_ASCENDING,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE));
|
2009-07-25 16:46:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkTreeViewColumn:sort-column-id:
|
|
|
|
*
|
|
|
|
* Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
|
|
|
|
* clickable. Set to %-1 to make the column unsortable.
|
|
|
|
*
|
|
|
|
* Since: 2.18
|
|
|
|
**/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_COLUMN_ID,
|
|
|
|
g_param_spec_int ("sort-column-id",
|
|
|
|
P_("Sort column ID"),
|
|
|
|
P_("Logical sort column ID this column sorts on when selected for sorting"),
|
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
|
|
|
-1,
|
|
|
|
GTK_PARAM_READWRITE));
|
2010-12-01 14:26:25 +00:00
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
/**
|
|
|
|
* GtkTreeViewColumn:cell-area:
|
|
|
|
*
|
|
|
|
* The #GtkCellArea used to layout cell renderers for this column.
|
|
|
|
*
|
2011-02-24 07:05:41 +00:00
|
|
|
* If no area is specified when creating the tree view column with gtk_tree_view_column_new_with_area()
|
|
|
|
* a horizontally oriented #GtkCellAreaBox will be used.
|
|
|
|
*
|
2010-12-01 14:26:25 +00:00
|
|
|
* Since: 3.0
|
|
|
|
*/
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_CELL_AREA,
|
|
|
|
g_param_spec_object ("cell-area",
|
|
|
|
P_("Cell Area"),
|
|
|
|
P_("The GtkCellArea used to layout cells"),
|
|
|
|
GTK_TYPE_CELL_AREA,
|
|
|
|
GTK_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_type_class_add_private (class, sizeof (GtkTreeViewColumnPrivate));
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2010-12-04 08:10:31 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_custom_tag_end (GtkBuildable *buildable,
|
|
|
|
GtkBuilder *builder,
|
|
|
|
GObject *child,
|
|
|
|
const gchar *tagname,
|
|
|
|
gpointer *data)
|
|
|
|
{
|
|
|
|
/* Just ignore the boolean return from here */
|
|
|
|
_gtk_cell_layout_buildable_custom_tag_end (buildable, builder, child, tagname, data);
|
|
|
|
}
|
|
|
|
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_buildable_init (GtkBuildableIface *iface)
|
|
|
|
{
|
2007-06-19 12:23:36 +00:00
|
|
|
iface->add_child = _gtk_cell_layout_buildable_add_child;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
iface->custom_tag_start = _gtk_cell_layout_buildable_custom_tag_start;
|
2010-12-04 08:10:31 +00:00
|
|
|
iface->custom_tag_end = gtk_tree_view_column_custom_tag_end;
|
Add GtkBuilder, fixes #172535
2007-06-15 Johan Dahlin <jdahlin@async.com.br>
* demos/gtk-demo/Makefile.am:
* demos/gtk-demo/builder.c: (quit_activate), (about_activate),
(do_builder):
* demos/gtk-demo/demo.ui:
* docs/reference/gtk/gtk-docs.sgml:
* docs/reference/gtk/gtk-sections.txt:
* docs/reference/gtk/gtk.types:
* docs/reference/gtk/tmpl/gtkbuildable.sgml:
* docs/reference/gtk/tmpl/gtkbuilder.sgml:
* gtk/Makefile.am:
* gtk/gtk.h:
* gtk/gtk.symbols:
* gtk/gtkaction.c: (gtk_action_buildable_init),
(gtk_action_buildable_set_name), (gtk_action_buildable_get_name):
* gtk/gtkactiongroup.c: (gtk_action_group_get_type),
(gtk_action_group_buildable_init),
(gtk_action_group_buildable_add),
(gtk_action_group_buildable_set_name),
(gtk_action_group_buildable_get_name):
* gtk/gtkbuildable.c: (gtk_buildable_get_type),
(gtk_buildable_set_name), (gtk_buildable_get_name),
(gtk_buildable_add), (gtk_buildable_set_property),
(gtk_buildable_parser_finished), (gtk_buildable_construct_child),
(gtk_buildable_custom_tag_start), (gtk_buildable_custom_tag_end),
(gtk_buildable_custom_finished),
(gtk_buildable_get_internal_child):
* gtk/gtkbuildable.h:
* gtk/gtkbuilder.c: (gtk_builder_class_init), (gtk_builder_init),
(gtk_builder_finalize), (gtk_builder_set_property),
(gtk_builder_get_property), (_gtk_builder_resolve_type_lazily),
(gtk_builder_real_get_type_from_name),
(gtk_builder_get_parameters), (gtk_builder_get_internal_child),
(_gtk_builder_construct), (_gtk_builder_add),
(apply_delayed_properties), (_gtk_builder_finish),
(gtk_builder_new), (gtk_builder_add_from_file),
(gtk_builder_add_from_string), (gtk_builder_get_object),
(object_add_to_list), (gtk_builder_get_objects),
(gtk_builder_set_translation_domain),
(gtk_builder_get_translation_domain),
(gtk_builder_connect_signals_default),
(gtk_builder_connect_signals), (gtk_builder_connect_signals_full),
(gtk_builder_value_from_string),
(gtk_builder_value_from_string_type),
(_gtk_builder_enum_from_string), (_gtk_builder_flags_from_string),
(gtk_builder_get_type_from_name), (gtk_builder_error_quark):
* gtk/gtkbuilder.h:
* gtk/gtkbuilderparser.c: (state_push), (state_peek), (state_pop),
(error_missing_attribute), (error_invalid_attribute),
(error_invalid_tag), (builder_construct), (parse_object),
(free_object_info), (_get_type_by_symbol), (parse_child),
(free_child_info), (parse_property), (free_property_info),
(parse_signal), (_free_signal_info), (parse_interface),
(create_subparser), (free_subparser), (subparser_start),
(subparser_end), (parse_custom), (start_element), (end_element),
(text), (_gtk_builder_parser_parse_buffer):
* gtk/gtkbuilderprivate.h:
* gtk/gtkcelllayout.c: (attributes_start_element),
(attributes_text_element),
(_gtk_cell_layout_buildable_custom_tag_start),
(_gtk_cell_layout_buildable_custom_tag_end),
(_gtk_cell_layout_buildable_add):
* gtk/gtkcelllayout.h:
* gtk/gtkcellview.c: (gtk_cell_view_buildable_init),
(gtk_cell_view_buildable_custom_tag_start),
(gtk_cell_view_buildable_custom_tag_end):
* gtk/gtkcolorseldialog.c:
(gtk_color_selection_dialog_buildable_interface_init),
(gtk_color_selection_dialog_buildable_get_internal_child):
* gtk/gtkcombobox.c: (gtk_combo_box_buildable_init),
(gtk_combo_box_buildable_custom_tag_start),
(gtk_combo_box_buildable_custom_tag_end):
* gtk/gtkcomboboxentry.c:
(gtk_combo_box_entry_buildable_interface_init),
(gtk_combo_box_entry_buildable_get_internal_child):
* gtk/gtkcontainer.c: (gtk_container_get_type),
(gtk_container_buildable_init), (gtk_container_buildable_add),
(gtk_container_buildable_set_child_property),
(attributes_start_element), (attributes_text_element),
(gtk_container_buildable_custom_tag_start),
(gtk_container_buildable_custom_tag_end):
* gtk/gtkdebug.h:
* gtk/gtkdialog.c: (gtk_dialog_buildable_interface_init),
(gtk_dialog_buildable_get_internal_child),
(attributes_start_element), (attributes_text_element),
(gtk_dialog_buildable_custom_tag_start),
(gtk_dialog_buildable_custom_finished):
* gtk/gtkentrycompletion.c: (gtk_entry_completion_buildable_init):
* gtk/gtkexpander.c: (gtk_expander_buildable_add),
(gtk_expander_buildable_init):
* gtk/gtkfontsel.c:
(gtk_font_selection_dialog_buildable_interface_init),
(gtk_font_selection_dialog_buildable_get_internal_child):
* gtk/gtkframe.c: (gtk_frame_buildable_init),
(gtk_frame_buildable_add):
* gtk/gtkiconview.c: (gtk_icon_view_buildable_init),
(gtk_icon_view_buildable_custom_tag_start),
(gtk_icon_view_buildable_custom_tag_end):
* gtk/gtkliststore.c: (gtk_list_store_buildable_init),
(list_store_start_element), (list_store_end_element),
(list_store_text), (gtk_list_store_buildable_custom_tag_start),
(gtk_list_store_buildable_custom_tag_end):
* gtk/gtkmain.c:
* gtk/gtknotebook.c: (gtk_notebook_buildable_init),
(gtk_notebook_buildable_add):
* gtk/gtksizegroup.c: (gtk_size_group_buildable_init),
(size_group_start_element),
(gtk_size_group_buildable_custom_tag_start),
(gtk_size_group_buildable_custom_finished):
* gtk/gtktreestore.c: (gtk_tree_store_buildable_init),
(tree_model_start_element),
(gtk_tree_store_buildable_custom_tag_start),
(gtk_tree_store_buildable_custom_finished):
* gtk/gtktreeview.c: (gtk_tree_view_buildable_init),
(gtk_tree_view_buildable_add):
* gtk/gtktreeviewcolumn.c: (gtk_tree_view_column_buildable_init):
* gtk/gtkuimanager.c: (gtk_ui_manager_buildable_init),
(gtk_ui_manager_buildable_add),
(gtk_ui_manager_buildable_construct_child),
(gtk_ui_manager_buildable_custom_tag_start),
(gtk_ui_manager_buildable_custom_tag_end):
* gtk/gtkwidget.c: (gtk_widget_get_type),
(gtk_widget_buildable_interface_init),
(gtk_widget_buildable_set_name), (gtk_widget_buildable_get_name),
(gtk_widget_buildable_set_property),
(gtk_widget_buildable_parser_finshed), (accel_group_start_element),
(gtk_widget_buildable_custom_tag_start),
(gtk_widget_buildable_custom_finshed):
* gtk/gtkwindow.c: (gtk_window_buildable_interface_init),
(gtk_window_buildable_set_property),
(gtk_window_buildable_parser_finished):
* tests/Makefile.am:
* tests/buildertest.c: (builder_new_from_string), (test_parser),
(signal_normal), (signal_after), (signal_object),
(signal_object_after), (signal_first), (signal_second),
(signal_extra), (signal_extra2), (test_connect_signals),
(test_uimanager_simple), (test_domain), (test_translation),
(test_sizegroup), (test_list_store), (test_tree_store),
(test_types), (test_spin_button), (test_notebook),
(test_construct_only_property), (test_children),
(test_child_properties), (test_treeview_column), (test_icon_view),
(test_combo_box), (test_combo_box_entry), (test_cell_view),
(test_dialog), (test_accelerators), (test_widget), (main):
Add GtkBuilder, fixes #172535
svn path=/trunk/; revision=18141
2007-06-15 17:53:46 +00:00
|
|
|
}
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_layout_init (GtkCellLayoutIface *iface)
|
|
|
|
{
|
2010-11-29 04:01:49 +00:00
|
|
|
iface->get_area = gtk_tree_view_column_cell_layout_get_area;
|
2003-07-11 12:51:24 +00:00
|
|
|
}
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
|
|
|
tree_column->priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_column,
|
|
|
|
GTK_TYPE_TREE_VIEW_COLUMN,
|
|
|
|
GtkTreeViewColumnPrivate);
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
priv->button = NULL;
|
|
|
|
priv->xalign = 0.0;
|
|
|
|
priv->width = 0;
|
2010-12-06 07:31:07 +00:00
|
|
|
priv->padding = -1;
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->min_width = -1;
|
|
|
|
priv->max_width = -1;
|
|
|
|
priv->resized_width = 0;
|
|
|
|
priv->column_type = GTK_TREE_VIEW_COLUMN_GROW_ONLY;
|
|
|
|
priv->visible = TRUE;
|
|
|
|
priv->resizable = FALSE;
|
|
|
|
priv->expand = FALSE;
|
|
|
|
priv->clickable = FALSE;
|
|
|
|
priv->dirty = TRUE;
|
|
|
|
priv->sort_order = GTK_SORT_ASCENDING;
|
|
|
|
priv->show_sort_indicator = FALSE;
|
|
|
|
priv->property_changed_signal = 0;
|
|
|
|
priv->sort_clicked_signal = 0;
|
|
|
|
priv->sort_column_changed_signal = 0;
|
|
|
|
priv->sort_column_id = -1;
|
|
|
|
priv->reorderable = FALSE;
|
|
|
|
priv->maybe_reordered = FALSE;
|
|
|
|
priv->fixed_width = 1;
|
|
|
|
priv->use_resized_width = FALSE;
|
|
|
|
priv->title = g_strdup ("");
|
2010-12-01 14:26:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GObject *
|
2011-01-31 22:34:37 +00:00
|
|
|
gtk_tree_view_column_constructor (GType type,
|
|
|
|
guint n_construct_properties,
|
|
|
|
GObjectConstructParam *construct_properties)
|
2010-12-01 14:26:25 +00:00
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
GObject *object;
|
|
|
|
|
|
|
|
object = G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->constructor
|
|
|
|
(type, n_construct_properties, construct_properties);
|
|
|
|
|
|
|
|
tree_column = (GtkTreeViewColumn *) object;
|
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
gtk_tree_view_column_ensure_cell_area (tree_column, NULL);
|
2010-11-29 04:01:49 +00:00
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
return object;
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-11-29 04:01:49 +00:00
|
|
|
gtk_tree_view_column_dispose (GObject *object)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2002-03-03 05:41:28 +00:00
|
|
|
|
2011-09-28 11:02:20 +00:00
|
|
|
/* 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);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->cell_area_context)
|
2010-12-02 08:42:46 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_disconnect (priv->cell_area_context,
|
|
|
|
priv->context_changed_signal);
|
2010-12-02 08:42:46 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_object_unref (priv->cell_area_context);
|
2010-12-02 08:42:46 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->cell_area_context = NULL;
|
|
|
|
priv->context_changed_signal = 0;
|
2010-11-29 04:01:49 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->cell_area)
|
2010-11-29 04:01:49 +00:00
|
|
|
{
|
2010-12-01 14:26:25 +00:00
|
|
|
g_signal_handler_disconnect (priv->cell_area,
|
|
|
|
priv->add_editable_signal);
|
|
|
|
g_signal_handler_disconnect (priv->cell_area,
|
|
|
|
priv->remove_editable_signal);
|
2011-01-31 22:34:37 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_object_unref (priv->cell_area);
|
|
|
|
priv->cell_area = NULL;
|
2010-12-01 14:26:25 +00:00
|
|
|
priv->add_editable_signal = 0;
|
|
|
|
priv->remove_editable_signal = 0;
|
2010-11-29 04:01:49 +00:00
|
|
|
}
|
Behaviour change, apply changes if the entry of the editable gets a focus
Tue Oct 15 00:53:14 2002 Kristian Rietveld <kris@gtk.org>
Behaviour change, apply changes if the entry of the editable gets
a focus out event (#82405).
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_focus_out_event):
new function,
(gtk_cell_renderer_text_start_editing): stop editing and apply
changes on focus-out.
Tue Oct 15 00:47:35 2002 Kristian Rietveld <kris@gtk.org>
Fixes an *evil* GtkTreeModelSort bug, #93629.
* gtk/gtktreemodel.c (release_row_references): return if the
refs->list is NULL.
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_changed): if we
are swapping two rows (re-insertion on row_changed), also *emit*
a rows_reordered signal. oops.
Tue Oct 15 00:45:03 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkliststore.c (gtk_list_store_remove_silently): free
the actual link after the node has been removed (#92014).
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_column_finalize):
free the cell_list and the child if the exists (#92014).
Tue Oct 15 00:40:25 2002 Kristian Rietveld <kris@gtk.org>
Don't accept drops if the model has been sorted, #93758)
* gtk/gtkliststore.c (gtk_list_store_row_drop_possible): return
FALSE if the list has been sorted.
* gtk/gtktreestore.c (gtk_tree_store_row_drop_possible): check
if drag_dest is a TreeStore, return FALSE if the tree has been
sorted.
Tue Oct 15 00:33:59 2002 Kristian Rietveld <kris@gtk.org>
Compiler warning fixage, (#85858, #85859, #85860, #85872)
* gtk/gtkcellrendererpixbuf (gtk_cell_renderer_pixbuf_render):
s/guint/GtkCellRendererState/.
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_render):
ditto.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render),
(gtk_cell_renderer_toggle_activate): ditto.
* gtk/gtkliststore.c (gtk_list_store_get_flags): a
s/guint/GtkTreeModelFlags/ on the return type.
2002-10-14 22:50:18 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->child)
|
2010-11-29 04:01:49 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
g_object_unref (priv->child);
|
|
|
|
priv->child = NULL;
|
2010-11-29 04:01:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_finalize (GObject *object)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
|
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2010-11-29 04:01:49 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_free (priv->title);
|
2001-08-23 16:54:49 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_OBJECT_CLASS (gtk_tree_view_column_parent_class)->finalize (object);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_set_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
const GValue *value,
|
2001-03-07 14:49:21 +00:00
|
|
|
GParamSpec *pspec)
|
2001-01-09 23:24:20 +00:00
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
2010-12-01 14:26:25 +00:00
|
|
|
GtkCellArea *area;
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_VISIBLE:
|
|
|
|
gtk_tree_view_column_set_visible (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
case PROP_RESIZABLE:
|
|
|
|
gtk_tree_view_column_set_resizable (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_SIZING:
|
|
|
|
gtk_tree_view_column_set_sizing (tree_column,
|
|
|
|
g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
case PROP_FIXED_WIDTH:
|
|
|
|
gtk_tree_view_column_set_fixed_width (tree_column,
|
|
|
|
g_value_get_int (value));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MIN_WIDTH:
|
|
|
|
gtk_tree_view_column_set_min_width (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MAX_WIDTH:
|
|
|
|
gtk_tree_view_column_set_max_width (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2004-07-15 17:37:06 +00:00
|
|
|
case PROP_SPACING:
|
|
|
|
gtk_tree_view_column_set_spacing (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_TITLE:
|
|
|
|
gtk_tree_view_column_set_title (tree_column,
|
|
|
|
g_value_get_string (value));
|
|
|
|
break;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
case PROP_EXPAND:
|
|
|
|
gtk_tree_view_column_set_expand (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_CLICKABLE:
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_WIDGET:
|
|
|
|
gtk_tree_view_column_set_widget (tree_column,
|
|
|
|
(GtkWidget*) g_value_get_object (value));
|
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_ALIGNMENT:
|
|
|
|
gtk_tree_view_column_set_alignment (tree_column,
|
|
|
|
g_value_get_float (value));
|
|
|
|
break;
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
case PROP_REORDERABLE:
|
|
|
|
gtk_tree_view_column_set_reorderable (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_SORT_INDICATOR:
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column,
|
|
|
|
g_value_get_boolean (value));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_SORT_ORDER:
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column,
|
|
|
|
g_value_get_enum (value));
|
|
|
|
break;
|
|
|
|
|
2009-07-25 16:46:09 +00:00
|
|
|
case PROP_SORT_COLUMN_ID:
|
|
|
|
gtk_tree_view_column_set_sort_column_id (tree_column,
|
|
|
|
g_value_get_int (value));
|
|
|
|
break;
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
|
|
case PROP_CELL_AREA:
|
|
|
|
/* Construct-only, can only be assigned once */
|
|
|
|
area = g_value_get_object (value);
|
|
|
|
|
|
|
|
if (area)
|
2011-01-31 22:34:37 +00:00
|
|
|
{
|
|
|
|
if (tree_column->priv->cell_area != NULL)
|
|
|
|
{
|
|
|
|
g_warning ("cell-area has already been set, ignoring construct property");
|
|
|
|
g_object_ref_sink (area);
|
|
|
|
g_object_unref (area);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_tree_view_column_ensure_cell_area (tree_column, area);
|
|
|
|
}
|
2010-12-01 14:26:25 +00:00
|
|
|
break;
|
2011-01-31 22:34:37 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_get_property (GObject *object,
|
|
|
|
guint prop_id,
|
|
|
|
GValue *value,
|
2001-03-07 14:49:21 +00:00
|
|
|
GParamSpec *pspec)
|
2001-01-09 23:24:20 +00:00
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
|
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (object);
|
|
|
|
|
|
|
|
switch (prop_id)
|
|
|
|
{
|
|
|
|
case PROP_VISIBLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_visible (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
case PROP_RESIZABLE:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_resizable (tree_column));
|
|
|
|
break;
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
case PROP_X_OFFSET:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_x_offset (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
case PROP_WIDTH:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_width (tree_column));
|
|
|
|
break;
|
|
|
|
|
2004-07-15 17:37:06 +00:00
|
|
|
case PROP_SPACING:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_spacing (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_SIZING:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_enum (value,
|
|
|
|
gtk_tree_view_column_get_sizing (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
case PROP_FIXED_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_int (value,
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_get_fixed_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MIN_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_min_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_MAX_WIDTH:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_max_width (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_TITLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_string (value,
|
|
|
|
gtk_tree_view_column_get_title (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
case PROP_EXPAND:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_expand (tree_column));
|
|
|
|
break;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
case PROP_CLICKABLE:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_clickable (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_WIDGET:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_value_set_object (value,
|
|
|
|
(GObject*) gtk_tree_view_column_get_widget (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_ALIGNMENT:
|
|
|
|
g_value_set_float (value,
|
|
|
|
gtk_tree_view_column_get_alignment (tree_column));
|
2001-01-09 23:24:20 +00:00
|
|
|
break;
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
case PROP_REORDERABLE:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_reorderable (tree_column));
|
|
|
|
break;
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
case PROP_SORT_INDICATOR:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
gtk_tree_view_column_get_sort_indicator (tree_column));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PROP_SORT_ORDER:
|
|
|
|
g_value_set_enum (value,
|
|
|
|
gtk_tree_view_column_get_sort_order (tree_column));
|
|
|
|
break;
|
|
|
|
|
2009-07-25 16:46:09 +00:00
|
|
|
case PROP_SORT_COLUMN_ID:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_sort_column_id (tree_column));
|
|
|
|
break;
|
2010-12-01 14:26:25 +00:00
|
|
|
|
|
|
|
case PROP_CELL_AREA:
|
2010-12-01 14:26:25 +00:00
|
|
|
g_value_set_object (value, tree_column->priv->cell_area);
|
2010-12-01 14:26:25 +00:00
|
|
|
break;
|
2009-07-25 16:46:09 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-07-11 12:51:24 +00:00
|
|
|
/* Implementation of GtkCellLayout interface
|
|
|
|
*/
|
2011-01-31 22:34:37 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_ensure_cell_area (GtkTreeViewColumn *column,
|
|
|
|
GtkCellArea *cell_area)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
if (priv->cell_area)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (cell_area)
|
|
|
|
priv->cell_area = cell_area;
|
|
|
|
else
|
|
|
|
priv->cell_area = gtk_cell_area_box_new ();
|
|
|
|
|
|
|
|
g_object_ref_sink (priv->cell_area);
|
|
|
|
|
|
|
|
priv->add_editable_signal =
|
|
|
|
g_signal_connect (priv->cell_area, "add-editable",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_add_editable_callback),
|
|
|
|
column);
|
|
|
|
priv->remove_editable_signal =
|
|
|
|
g_signal_connect (priv->cell_area, "remove-editable",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_remove_editable_callback),
|
|
|
|
column);
|
|
|
|
|
|
|
|
priv->cell_area_context = gtk_cell_area_create_context (priv->cell_area);
|
|
|
|
|
|
|
|
priv->context_changed_signal =
|
|
|
|
g_signal_connect (priv->cell_area_context, "notify",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_context_changed),
|
|
|
|
column);
|
|
|
|
}
|
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
static GtkCellArea *
|
|
|
|
gtk_tree_view_column_cell_layout_get_area (GtkCellLayout *cell_layout)
|
2003-07-11 12:51:24 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *column = GTK_TREE_VIEW_COLUMN (cell_layout);
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2003-07-11 12:51:24 +00:00
|
|
|
|
2011-01-31 22:34:37 +00:00
|
|
|
if (G_UNLIKELY (!priv->cell_area))
|
|
|
|
gtk_tree_view_column_ensure_cell_area (column, NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return priv->cell_area;
|
2003-12-19 22:47:20 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Button handling code
|
|
|
|
*/
|
2001-02-17 00:16:08 +00:00
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
|
2001-02-17 00:16:08 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkTreeView *tree_view;
|
|
|
|
GtkWidget *child;
|
|
|
|
GtkWidget *hbox;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
tree_view = (GtkTreeView *) priv->tree_view;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
2010-11-30 05:29:45 +00:00
|
|
|
g_return_if_fail (priv->button == NULL);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
gtk_widget_push_composite_child ();
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->button = gtk_button_new ();
|
|
|
|
gtk_widget_add_events (priv->button, GDK_POINTER_MOTION_MASK);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_pop_composite_child ();
|
|
|
|
|
|
|
|
/* make sure we own a reference to it as well. */
|
2010-11-30 07:36:07 +00:00
|
|
|
if (_gtk_tree_view_get_header_window (tree_view))
|
|
|
|
gtk_widget_set_parent_window (priv->button, _gtk_tree_view_get_header_window (tree_view));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_set_parent (priv->button, GTK_WIDGET (tree_view));
|
2002-02-19 21:16:49 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_connect (priv->button, "event",
|
2002-02-19 21:16:49 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_column_button_event),
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column);
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_connect (priv->button, "clicked",
|
2002-10-13 19:34:42 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_column_button_clicked),
|
|
|
|
tree_column);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->alignment = gtk_alignment_new (priv->xalign, 0.5, 0.0, 0.0);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-10-31 17:07:20 +00:00
|
|
|
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->child)
|
|
|
|
child = priv->child;
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
child = gtk_label_new (priv->title);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_show (child);
|
|
|
|
}
|
|
|
|
|
2008-08-08 14:23:32 +00:00
|
|
|
g_signal_connect (child, "mnemonic-activate",
|
2002-02-19 21:16:49 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_column_mnemonic_activate),
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->xalign <= 0.5)
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), priv->arrow, FALSE, FALSE, 0);
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), priv->arrow, FALSE, FALSE, 0);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), priv->alignment, TRUE, TRUE, 0);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_container_add (GTK_CONTAINER (priv->alignment), child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (priv->button), hbox);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
gtk_widget_show (hbox);
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_show (priv->alignment);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-02-17 00:16:08 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_update_button (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2006-09-24 17:03:45 +00:00
|
|
|
gint sort_column_id = -1;
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *arrow;
|
|
|
|
GtkWidget *current_child;
|
2006-05-28 12:37:21 +00:00
|
|
|
GtkArrowType arrow_type = GTK_ARROW_NONE;
|
2006-05-30 09:29:49 +00:00
|
|
|
GtkTreeModel *model;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->tree_view)
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
2006-05-30 09:29:49 +00:00
|
|
|
else
|
|
|
|
model = NULL;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* Create a button if necessary */
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible &&
|
|
|
|
priv->button == NULL &&
|
|
|
|
priv->tree_view &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_create_button (tree_column);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (! priv->button)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
hbox = gtk_bin_get_child (GTK_BIN (priv->button));
|
|
|
|
alignment = priv->alignment;
|
|
|
|
arrow = priv->arrow;
|
2010-05-24 20:31:36 +00:00
|
|
|
current_child = gtk_bin_get_child (GTK_BIN (alignment));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* Set up the actual button */
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), priv->xalign,
|
2001-05-16 00:23:30 +00:00
|
|
|
0.5, 0.0, 0.0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->child)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
if (current_child != priv->child)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (alignment),
|
|
|
|
current_child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment),
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->child);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (current_child == NULL)
|
|
|
|
{
|
|
|
|
current_child = gtk_label_new (NULL);
|
|
|
|
gtk_widget_show (current_child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment),
|
|
|
|
current_child);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_LABEL (current_child));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->title)
|
2002-02-19 21:16:49 +00:00
|
|
|
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->title);
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
2002-02-19 21:16:49 +00:00
|
|
|
gtk_label_set_text_with_mnemonic (GTK_LABEL (current_child),
|
|
|
|
"");
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2006-09-24 17:03:45 +00:00
|
|
|
if (GTK_IS_TREE_SORTABLE (model))
|
|
|
|
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
|
|
|
|
&sort_column_id,
|
|
|
|
NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->show_sort_indicator)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2006-12-27 19:52:25 +00:00
|
|
|
gboolean alternative;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_object_get (gtk_widget_get_settings (priv->tree_view),
|
2006-12-27 19:52:25 +00:00
|
|
|
"gtk-alternative-sort-arrows", &alternative,
|
|
|
|
NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
switch (priv->sort_order)
|
2006-09-24 17:03:45 +00:00
|
|
|
{
|
|
|
|
case GTK_SORT_ASCENDING:
|
2006-12-27 19:52:25 +00:00
|
|
|
arrow_type = alternative ? GTK_ARROW_UP : GTK_ARROW_DOWN;
|
2006-09-24 17:03:45 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case GTK_SORT_DESCENDING:
|
2006-12-27 19:52:25 +00:00
|
|
|
arrow_type = alternative ? GTK_ARROW_DOWN : GTK_ARROW_UP;
|
2006-09-24 17:03:45 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_warning (G_STRLOC": bad sort order");
|
|
|
|
break;
|
2006-05-28 12:37:21 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2006-05-28 12:37:21 +00:00
|
|
|
gtk_arrow_set (GTK_ARROW (arrow),
|
|
|
|
arrow_type,
|
|
|
|
GTK_SHADOW_IN);
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
/* Put arrow on the right if the text is left-or-center justified, and on the
|
|
|
|
* left otherwise; do this by packing boxes, so flipping text direction will
|
|
|
|
* reverse things
|
|
|
|
*/
|
2002-10-13 19:34:42 +00:00
|
|
|
g_object_ref (arrow);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_container_remove (GTK_CONTAINER (hbox), arrow);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->xalign <= 0.5)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
|
|
|
|
/* move it to the front */
|
|
|
|
gtk_box_reorder_child (GTK_BOX (hbox), arrow, 0);
|
|
|
|
}
|
2002-10-13 19:34:42 +00:00
|
|
|
g_object_unref (arrow);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->show_sort_indicator
|
|
|
|
|| (GTK_IS_TREE_SORTABLE (model) && priv->sort_column_id >= 0))
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_show (arrow);
|
|
|
|
else
|
|
|
|
gtk_widget_hide (arrow);
|
|
|
|
|
2002-04-05 16:11:32 +00:00
|
|
|
/* It's always safe to hide the button. It isn't always safe to show it, as
|
|
|
|
* if you show it before it's realized, it'll get the wrong window. */
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->button &&
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-12-23 17:19:11 +00:00
|
|
|
if (gdk_window_is_visible (_gtk_tree_view_get_header_window (GTK_TREE_VIEW (priv->tree_view))))
|
|
|
|
gtk_widget_show_now (priv->button);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->window)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->resizable)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gdk_window_show (priv->window);
|
|
|
|
gdk_window_raise (priv->window);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gdk_window_hide (priv->window);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_hide (priv->button);
|
|
|
|
if (priv->window)
|
|
|
|
gdk_window_hide (priv->window);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->reorderable || priv->clickable)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_set_can_focus (priv->button, TRUE);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
else
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_set_can_focus (priv->button, FALSE);
|
|
|
|
if (gtk_widget_has_focus (priv->button))
|
2001-07-05 02:58:34 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkWidget *toplevel = gtk_widget_get_toplevel (priv->tree_view);
|
2010-01-04 06:49:26 +00:00
|
|
|
if (gtk_widget_is_toplevel (toplevel))
|
2001-10-31 22:57:51 +00:00
|
|
|
{
|
|
|
|
gtk_window_set_focus (GTK_WINDOW (toplevel), NULL);
|
|
|
|
}
|
2001-07-05 02:58:34 +00:00
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2002-01-18 00:23:26 +00:00
|
|
|
/* Queue a resize on the assumption that we always want to catch all changes
|
|
|
|
* and columns don't change all that often.
|
|
|
|
*/
|
2010-11-30 05:29:45 +00:00
|
|
|
if (gtk_widget_get_realized (priv->tree_view))
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2002-01-18 00:23:26 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Button signal handlers
|
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
static gint
|
2001-05-22 19:18:47 +00:00
|
|
|
gtk_tree_view_column_button_event (GtkWidget *widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gpointer data)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *column = (GtkTreeViewColumn *) data;
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2001-05-22 19:18:47 +00:00
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
if (event->type == GDK_BUTTON_PRESS &&
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->reorderable &&
|
2012-01-25 18:05:25 +00:00
|
|
|
((GdkEventButton *)event)->button == GDK_BUTTON_PRIMARY)
|
2001-05-22 19:18:47 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->maybe_reordered = TRUE;
|
2011-11-02 11:20:28 +00:00
|
|
|
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);
|
2001-05-22 19:18:47 +00:00
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
}
|
|
|
|
|
2004-12-08 03:17:41 +00:00
|
|
|
if (event->type == GDK_BUTTON_RELEASE ||
|
|
|
|
event->type == GDK_LEAVE_NOTIFY)
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->maybe_reordered = FALSE;
|
2004-12-08 03:17:41 +00:00
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
if (event->type == GDK_MOTION_NOTIFY &&
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->maybe_reordered &&
|
2001-05-22 19:18:47 +00:00
|
|
|
(gtk_drag_check_threshold (widget,
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->drag_x,
|
|
|
|
priv->drag_y,
|
2001-05-22 19:18:47 +00:00
|
|
|
(gint) ((GdkEventMotion *)event)->x,
|
|
|
|
(gint) ((GdkEventMotion *)event)->y)))
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->maybe_reordered = FALSE;
|
|
|
|
_gtk_tree_view_column_start_drag (GTK_TREE_VIEW (priv->tree_view), column,
|
2010-05-25 22:38:44 +00:00
|
|
|
event->motion.device);
|
2000-10-05 01:04:57 +00:00
|
|
|
return TRUE;
|
2001-05-22 19:18:47 +00:00
|
|
|
}
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
|
|
if (priv->clickable == FALSE)
|
2001-05-22 19:18:47 +00:00
|
|
|
{
|
|
|
|
switch (event->type)
|
|
|
|
{
|
|
|
|
case GDK_BUTTON_PRESS:
|
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
case GDK_3BUTTON_PRESS:
|
|
|
|
case GDK_MOTION_NOTIFY:
|
|
|
|
case GDK_BUTTON_RELEASE:
|
|
|
|
case GDK_ENTER_NOTIFY:
|
|
|
|
case GDK_LEAVE_NOTIFY:
|
|
|
|
return TRUE;
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
2002-10-13 19:34:42 +00:00
|
|
|
g_signal_emit_by_name (data, "clicked");
|
2001-04-12 16:11:54 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2002-02-19 21:16:49 +00:00
|
|
|
static gboolean
|
|
|
|
gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
|
|
|
|
gboolean group_cycling,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *column = (GtkTreeViewColumn *)data;
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2002-02-19 21:16:49 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), FALSE);
|
|
|
|
|
2010-11-30 07:36:07 +00:00
|
|
|
_gtk_tree_view_set_focus_column (GTK_TREE_VIEW (priv->tree_view), column);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
|
|
|
if (priv->clickable)
|
|
|
|
gtk_button_clicked (GTK_BUTTON (priv->button));
|
|
|
|
else if (gtk_widget_get_can_focus (priv->button))
|
|
|
|
gtk_widget_grab_focus (priv->button);
|
2002-02-19 21:16:49 +00:00
|
|
|
else
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_grab_focus (priv->tree_view);
|
2002-02-19 21:16:49 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2001-04-12 16:11:54 +00:00
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
2001-12-04 23:49:57 +00:00
|
|
|
GtkTreeViewColumn *column)
|
2001-04-12 16:11:54 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2001-05-16 00:23:30 +00:00
|
|
|
gint sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType order;
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (gtk_tree_sortable_get_sort_column_id (sortable,
|
|
|
|
&sort_column_id,
|
|
|
|
&order))
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
if (sort_column_id == priv->sort_column_id)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sort_order (column, order);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
|
|
|
}
|
|
|
|
}
|
2001-10-09 18:51:43 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
|
|
|
}
|
2001-04-12 16:11:54 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_sort (GtkTreeViewColumn *tree_column,
|
|
|
|
gpointer data)
|
2001-03-02 00:49:32 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeSortable *sortable;
|
2001-10-06 00:50:36 +00:00
|
|
|
gint sort_column_id;
|
|
|
|
GtkSortType order;
|
|
|
|
gboolean has_sort_column;
|
|
|
|
gboolean has_default_sort_func;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_return_if_fail (priv->tree_view != NULL);
|
|
|
|
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
|
|
|
sortable = GTK_TREE_SORTABLE (model);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-10-06 00:50:36 +00:00
|
|
|
has_sort_column =
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_tree_sortable_get_sort_column_id (sortable,
|
2001-10-06 00:50:36 +00:00
|
|
|
&sort_column_id,
|
|
|
|
&order);
|
|
|
|
has_default_sort_func =
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_tree_sortable_has_default_sort_func (sortable);
|
2001-10-06 00:50:36 +00:00
|
|
|
|
|
|
|
if (has_sort_column &&
|
2010-11-30 05:29:45 +00:00
|
|
|
sort_column_id == priv->sort_column_id)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
if (order == GTK_SORT_ASCENDING)
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
|
|
|
priv->sort_column_id,
|
2001-10-06 00:50:36 +00:00
|
|
|
GTK_SORT_DESCENDING);
|
|
|
|
else if (order == GTK_SORT_DESCENDING && has_default_sort_func)
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
2001-10-06 00:50:36 +00:00
|
|
|
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
|
|
|
priv->sort_column_id,
|
2001-10-06 00:50:36 +00:00
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (sortable,
|
|
|
|
priv->sort_column_id,
|
2001-10-06 00:50:36 +00:00
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkTreeModel *model;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->tree_view == NULL)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
if (model == NULL)
|
2001-08-21 04:49:15 +00:00
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (GTK_IS_TREE_SORTABLE (model) &&
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->sort_column_id != -1)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gint real_sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType real_order;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->sort_column_changed_signal == 0)
|
|
|
|
priv->sort_column_changed_signal =
|
2008-08-08 14:23:32 +00:00
|
|
|
g_signal_connect (model, "sort-column-changed",
|
2002-10-13 19:34:42 +00:00
|
|
|
G_CALLBACK (gtk_tree_view_model_sort_column_changed),
|
|
|
|
tree_column);
|
2010-11-30 05:29:45 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (model),
|
|
|
|
&real_sort_column_id,
|
|
|
|
&real_order) &&
|
2010-11-30 05:29:45 +00:00
|
|
|
(real_sort_column_id == priv->sort_column_id))
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, real_order);
|
2004-10-03 06:12:09 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
2004-10-03 06:12:09 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2010-11-29 04:01:49 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_context_changed (GtkCellAreaContext *context,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2010-12-06 08:03:53 +00:00
|
|
|
/* Here we want the column re-requested if the underlying context was
|
|
|
|
* actually reset for any reason, this can happen if the underlying
|
|
|
|
* area/cell configuration changes (i.e. cell packing properties
|
|
|
|
* or cell spacing and the like)
|
|
|
|
*
|
|
|
|
* Note that we block this handler while requesting for sizes
|
|
|
|
* so there is no need to check for the new context size being -1,
|
|
|
|
* we also block the handler when explicitly resetting the context
|
|
|
|
* so as to avoid some infinite stack recursion.
|
|
|
|
*/
|
2010-11-29 04:01:49 +00:00
|
|
|
if (!strcmp (pspec->name, "minimum-width") ||
|
|
|
|
!strcmp (pspec->name, "natural-width") ||
|
|
|
|
!strcmp (pspec->name, "minimum-height") ||
|
|
|
|
!strcmp (pspec->name, "natural-height"))
|
2010-12-12 07:43:07 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
2010-11-29 04:01:49 +00:00
|
|
|
}
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_add_editable_callback (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
const gchar *path_string,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *column = user_data;
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
GtkTreePath *path;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
if (priv->tree_view)
|
|
|
|
{
|
|
|
|
path = gtk_tree_path_new_from_string (path_string);
|
|
|
|
|
|
|
|
_gtk_tree_view_add_editable (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
column,
|
|
|
|
path,
|
|
|
|
edit_widget,
|
|
|
|
cell_area);
|
|
|
|
|
|
|
|
gtk_tree_path_free (path);
|
|
|
|
}
|
2010-11-28 18:01:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_remove_editable_callback (GtkCellArea *area,
|
|
|
|
GtkCellRenderer *renderer,
|
|
|
|
GtkCellEditable *edit_widget,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumn *column = user_data;
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2010-11-28 18:01:49 +00:00
|
|
|
|
2010-12-01 14:26:25 +00:00
|
|
|
if (priv->tree_view)
|
|
|
|
_gtk_tree_view_remove_editable (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
column,
|
|
|
|
edit_widget);
|
2010-11-28 18:01:49 +00:00
|
|
|
}
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Exported Private Functions.
|
|
|
|
* These should only be called by gtktreeview.c or gtktreeviewcolumn.c
|
|
|
|
*/
|
2001-03-02 00:49:32 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2010-08-11 20:50:01 +00:00
|
|
|
GtkAllocation allocation;
|
2001-03-02 00:49:32 +00:00
|
|
|
GtkTreeView *tree_view;
|
|
|
|
GdkWindowAttr attr;
|
|
|
|
guint attributes_mask;
|
2003-11-29 06:16:11 +00:00
|
|
|
gboolean rtl;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
tree_view = (GtkTreeView *)priv->tree_view;
|
|
|
|
rtl = (gtk_widget_get_direction (priv->tree_view) == GTK_TEXT_DIR_RTL);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
2010-11-30 05:29:45 +00:00
|
|
|
g_return_if_fail (gtk_widget_get_realized (priv->tree_view));
|
|
|
|
g_return_if_fail (priv->button != NULL);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2010-11-30 07:36:07 +00:00
|
|
|
g_return_if_fail (_gtk_tree_view_get_header_window (tree_view) != NULL);
|
|
|
|
gtk_widget_set_parent_window (priv->button, _gtk_tree_view_get_header_window (tree_view));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
attr.window_type = GDK_WINDOW_CHILD;
|
|
|
|
attr.wclass = GDK_INPUT_ONLY;
|
|
|
|
attr.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
|
2003-07-17 17:09:57 +00:00
|
|
|
attr.event_mask = gtk_widget_get_events (GTK_WIDGET (tree_view)) |
|
|
|
|
(GDK_BUTTON_PRESS_MASK |
|
2001-03-02 00:49:32 +00:00
|
|
|
GDK_BUTTON_RELEASE_MASK |
|
|
|
|
GDK_POINTER_MOTION_MASK |
|
|
|
|
GDK_POINTER_MOTION_HINT_MASK |
|
|
|
|
GDK_KEY_PRESS_MASK);
|
|
|
|
attributes_mask = GDK_WA_CURSOR | GDK_WA_X | GDK_WA_Y;
|
2010-11-30 07:36:07 +00:00
|
|
|
attr.cursor = gdk_cursor_new_for_display
|
|
|
|
(gdk_window_get_display (_gtk_tree_view_get_header_window (tree_view)), GDK_SB_H_DOUBLE_ARROW);
|
2001-03-02 00:49:32 +00:00
|
|
|
attr.y = 0;
|
|
|
|
attr.width = TREE_VIEW_DRAG_WIDTH;
|
2010-11-30 07:36:07 +00:00
|
|
|
attr.height = _gtk_tree_view_get_header_height (tree_view);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_get_allocation (priv->button, &allocation);
|
|
|
|
attr.x = (allocation.x + (rtl ? 0 : allocation.width)) - TREE_VIEW_DRAG_WIDTH / 2;
|
2010-11-30 07:36:07 +00:00
|
|
|
priv->window = gdk_window_new (_gtk_tree_view_get_header_window (tree_view),
|
|
|
|
&attr, attributes_mask);
|
2010-11-30 05:29:45 +00:00
|
|
|
gdk_window_set_user_data (priv->window, tree_view);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
gtk_tree_view_column_update_button (column);
|
2001-12-03 21:20:12 +00:00
|
|
|
|
2010-12-20 02:14:38 +00:00
|
|
|
g_object_unref (attr.cursor);
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unrealize_button (GtkTreeViewColumn *column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
g_return_if_fail (column != NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = column->priv;
|
|
|
|
g_return_if_fail (priv->window != NULL);
|
|
|
|
|
|
|
|
gdk_window_set_user_data (priv->window, NULL);
|
|
|
|
gdk_window_destroy (priv->window);
|
|
|
|
priv->window = NULL;
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unset_model (GtkTreeViewColumn *column,
|
|
|
|
GtkTreeModel *old_model)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
if (priv->sort_column_changed_signal)
|
2002-10-13 19:34:42 +00:00
|
|
|
{
|
|
|
|
g_signal_handler_disconnect (old_model,
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->sort_column_changed_signal);
|
|
|
|
priv->sort_column_changed_signal = 0;
|
2002-10-13 19:34:42 +00:00
|
|
|
}
|
2004-10-03 06:12:09 +00:00
|
|
|
gtk_tree_view_column_set_sort_indicator (column, FALSE);
|
API additions: _move, _reorder and _swap for stores, path constructor.
Fri Jul 26 22:53:37 2002 Kristian Rietveld <kris@gtk.org>
API additions: _move, _reorder and _swap for stores, path
constructor.
* gtk/gtktreemodel.[ch] (gtk_tree_path_new_from_indices): new function.
* gtk/gtkliststore.[ch]: added gtk_list_store_reorder_func (private),
gtk_list_store_reorder, gtk_list_store_swap, gtk_list_store_move.
* gtk/gtktreestore.[ch]: added gtk_tree_store_reorder_func (private),
gtk_tree_store_reorder, gtk_tree_store_swap, gtk_tree_store_move.
Fri Jul 26 22:32:57 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreestore.c (node_free): return FALSE,
(gtk_tree_store_finalize): use g_node_traverse instead of
g_node_children_foreach, so the whole tree will be freed (#88854,
patch from Emmanuel Briot).
Fri Jul 26 22:32:24 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_button_press): fix some memleaks,
(#84426, patch from Matthias Clasen).
Fri Jul 26 22:31:25 2002 Kristian Rietveld <kris@gtk.org>
Merge from stable:
* gtk/gtktreeview.c (gtk_tree_view_unref_tree_helper): _iter_children
check shouldn't be in g_return_return_val_if_fail (pointed out by
Josh Green, #88997),
(gtk_tree_view_set_model): call _gtk_tree_view_column_unset_model
for each column when we unset the model (part of #82484),
(gtk_tree_view_get_cell_area): return if we ran out of tree or
if we got an invalid path (#82376).
* gtk/gtktreeprivate.h: add _gtk_tree_view_column_unset_model.
* gtk/gtktreeviewcolumn.c: implement _gtk_tree_view_column_unset_model
which disconnects the sort_column_changed_signal (part of #82484).
* gtk/gtkliststore.c (gtk_list_store_insert): append row if the
given postion is off the end of the tree (#85813).
* gtk/gtkentry.c (gtk_cell_editable_key_press_event): let's use
2-space indent, commit changes if up/down keys has been pressed,
this overrides the focus key foo so the user won't be surprised
(#84665).
2002-07-26 20:51:13 +00:00
|
|
|
}
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
|
|
|
|
GtkTreeView *tree_view)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
g_assert (priv->tree_view == NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->tree_view = GTK_WIDGET (tree_view);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_create_button (column);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->property_changed_signal =
|
2010-12-01 14:26:25 +00:00
|
|
|
g_signal_connect_swapped (tree_view,
|
|
|
|
"notify::model",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_setup_sort_column_id_callback),
|
|
|
|
column);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (column);
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unset_tree_view (GtkTreeViewColumn *column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
if (priv->tree_view && priv->button)
|
2001-03-02 00:49:32 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_container_remove (GTK_CONTAINER (priv->tree_view), priv->button);
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->property_changed_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_disconnect (priv->tree_view, priv->property_changed_signal);
|
|
|
|
priv->property_changed_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->sort_column_changed_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_disconnect (gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view)),
|
|
|
|
priv->sort_column_changed_signal);
|
|
|
|
priv->sort_column_changed_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->tree_view = NULL;
|
|
|
|
priv->button = NULL;
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
2002-04-09 19:48:32 +00:00
|
|
|
gboolean
|
|
|
|
_gtk_tree_view_column_has_editable_cell (GtkTreeViewColumn *column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
2010-11-28 18:01:49 +00:00
|
|
|
gboolean ret = FALSE;
|
|
|
|
GList *list, *cells;
|
2002-04-09 19:48:32 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->cell_area));
|
2010-11-28 18:01:49 +00:00
|
|
|
|
|
|
|
for (list = cells; list; list = list->next)
|
2010-05-30 20:38:33 +00:00
|
|
|
{
|
2010-11-28 18:01:49 +00:00
|
|
|
GtkCellRenderer *cell = list->data;
|
|
|
|
GtkCellRendererMode mode;
|
|
|
|
|
2010-05-30 20:38:33 +00:00
|
|
|
g_object_get (cell, "mode", &mode, NULL);
|
2010-11-28 18:01:49 +00:00
|
|
|
|
2010-05-30 20:38:33 +00:00
|
|
|
if (mode == GTK_CELL_RENDERER_MODE_EDITABLE)
|
2010-11-28 18:01:49 +00:00
|
|
|
{
|
|
|
|
ret = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
2010-05-30 20:38:33 +00:00
|
|
|
}
|
2002-04-09 19:48:32 +00:00
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
g_list_free (cells);
|
|
|
|
|
|
|
|
return ret;
|
2002-04-09 19:48:32 +00:00
|
|
|
}
|
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/* gets cell being edited */
|
2002-04-14 15:05:04 +00:00
|
|
|
GtkCellRenderer *
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
_gtk_tree_view_column_get_edited_cell (GtkTreeViewColumn *column)
|
2002-04-14 15:05:04 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
return gtk_cell_area_get_edited_cell (priv->cell_area);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
}
|
|
|
|
|
2010-12-05 17:18:36 +00:00
|
|
|
GtkCellRenderer *
|
|
|
|
_gtk_tree_view_column_get_cell_at_pos (GtkTreeViewColumn *column,
|
2010-12-12 14:22:49 +00:00
|
|
|
GdkRectangle *cell_area,
|
2010-12-15 22:45:04 +00:00
|
|
|
GdkRectangle *background_area,
|
2010-12-12 14:22:49 +00:00
|
|
|
gint x,
|
|
|
|
gint y)
|
2010-12-05 17:18:36 +00:00
|
|
|
{
|
|
|
|
GtkCellRenderer *match = NULL;
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
2010-12-15 22:45:04 +00:00
|
|
|
/* If (x, y) is outside of the background area, immediately return */
|
|
|
|
if (x < background_area->x ||
|
|
|
|
x > background_area->x + background_area->width ||
|
|
|
|
y < background_area->y ||
|
|
|
|
y > background_area->y + background_area->height)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
/* If (x, y) is inside the background area, clamp it to the cell_area
|
|
|
|
* so that a cell is still returned. The main reason for doing this
|
|
|
|
* (on the x axis) is for handling clicks in the indentation area
|
|
|
|
* (either at the left or right depending on RTL setting). Another
|
|
|
|
* reason is for handling clicks on the area where the focus rectangle
|
|
|
|
* is drawn (this is outside of cell area), this manifests itself
|
|
|
|
* mainly when a large setting is used for focus-line-width.
|
|
|
|
*/
|
2010-12-12 16:32:59 +00:00
|
|
|
if (x < cell_area->x)
|
2010-12-15 22:45:04 +00:00
|
|
|
x = cell_area->x;
|
|
|
|
else if (x > cell_area->x + cell_area->width)
|
|
|
|
x = cell_area->x + cell_area->width;
|
|
|
|
|
|
|
|
if (y < cell_area->y)
|
|
|
|
y = cell_area->y;
|
|
|
|
else if (y > cell_area->y + cell_area->height)
|
|
|
|
y = cell_area->y + cell_area->height;
|
2010-12-12 16:32:59 +00:00
|
|
|
|
2010-12-12 14:22:49 +00:00
|
|
|
match = gtk_cell_area_get_cell_at_position (priv->cell_area,
|
|
|
|
priv->cell_area_context,
|
|
|
|
priv->tree_view,
|
|
|
|
cell_area,
|
|
|
|
x, y,
|
|
|
|
NULL);
|
2010-12-05 17:18:36 +00:00
|
|
|
|
|
|
|
return match;
|
|
|
|
}
|
|
|
|
|
2011-01-07 14:35:35 +00:00
|
|
|
gboolean
|
|
|
|
_gtk_tree_view_column_is_blank_at_pos (GtkTreeViewColumn *column,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
GdkRectangle *background_area,
|
|
|
|
gint x,
|
|
|
|
gint y)
|
|
|
|
{
|
|
|
|
GtkCellRenderer *match;
|
|
|
|
GdkRectangle cell_alloc, aligned_area, inner_area;
|
|
|
|
GtkTreeViewColumnPrivate *priv = column->priv;
|
|
|
|
|
|
|
|
match = _gtk_tree_view_column_get_cell_at_pos (column,
|
|
|
|
cell_area,
|
|
|
|
background_area,
|
|
|
|
x, y);
|
|
|
|
if (!match)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
gtk_cell_area_get_cell_allocation (priv->cell_area,
|
|
|
|
priv->cell_area_context,
|
|
|
|
priv->tree_view,
|
|
|
|
match,
|
|
|
|
cell_area,
|
|
|
|
&cell_alloc);
|
|
|
|
|
|
|
|
gtk_cell_area_inner_cell_area (priv->cell_area, priv->tree_view,
|
|
|
|
&cell_alloc, &inner_area);
|
|
|
|
gtk_cell_renderer_get_aligned_area (match, priv->tree_view, 0,
|
|
|
|
&inner_area, &aligned_area);
|
|
|
|
|
|
|
|
if (x < aligned_area.x ||
|
|
|
|
x > aligned_area.x + aligned_area.width ||
|
|
|
|
y < aligned_area.y ||
|
|
|
|
y > aligned_area.y + aligned_area.height)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
/* Public Functions */
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_new:
|
|
|
|
*
|
|
|
|
* Creates a new #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkTreeViewColumn.
|
|
|
|
**/
|
2000-11-09 16:52:17 +00:00
|
|
|
GtkTreeViewColumn *
|
2000-10-05 01:04:57 +00:00
|
|
|
gtk_tree_view_column_new (void)
|
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkTreeViewColumn *tree_column;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2002-10-13 19:34:42 +00:00
|
|
|
tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, NULL);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return tree_column;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2010-12-06 10:04:51 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_new_with_area:
|
|
|
|
* @area: the #GtkCellArea that the newly created column should use to layout cells.
|
|
|
|
*
|
2011-02-23 09:26:21 +00:00
|
|
|
* Creates a new #GtkTreeViewColumn using @area to render its cells.
|
2010-12-06 10:04:51 +00:00
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
*/
|
|
|
|
GtkTreeViewColumn *
|
|
|
|
gtk_tree_view_column_new_with_area (GtkCellArea *area)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column;
|
|
|
|
|
|
|
|
tree_column = g_object_new (GTK_TYPE_TREE_VIEW_COLUMN, "cell-area", area, NULL);
|
|
|
|
|
|
|
|
return tree_column;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_new_with_attributes:
|
2011-09-26 00:58:59 +00:00
|
|
|
* @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(),
|
2001-12-08 21:39:34 +00:00
|
|
|
* gtk_tree_view_column_pack_start(), and
|
|
|
|
* gtk_tree_view_column_set_attributes() on the newly created #GtkTreeViewColumn.
|
2002-03-15 21:47:52 +00:00
|
|
|
*
|
|
|
|
* Here's a simple example:
|
2007-11-25 06:51:19 +00:00
|
|
|
* |[
|
2002-04-18 22:04:46 +00:00
|
|
|
* enum { TEXT_COLUMN, COLOR_COLUMN, N_COLUMNS };
|
|
|
|
* ...
|
|
|
|
* {
|
|
|
|
* GtkTreeViewColumn *column;
|
2007-11-25 06:51:19 +00:00
|
|
|
* GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
|
2002-04-18 22:04:46 +00:00
|
|
|
*
|
|
|
|
* column = gtk_tree_view_column_new_with_attributes ("Title",
|
|
|
|
* renderer,
|
|
|
|
* "text", TEXT_COLUMN,
|
|
|
|
* "foreground", COLOR_COLUMN,
|
|
|
|
* NULL);
|
|
|
|
* }
|
2007-11-25 06:51:19 +00:00
|
|
|
* ]|
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Return value: A newly created #GtkTreeViewColumn.
|
|
|
|
**/
|
2000-11-09 16:52:17 +00:00
|
|
|
GtkTreeViewColumn *
|
2001-02-17 00:16:08 +00:00
|
|
|
gtk_tree_view_column_new_with_attributes (const gchar *title,
|
2000-10-05 01:04:57 +00:00
|
|
|
GtkCellRenderer *cell,
|
|
|
|
...)
|
|
|
|
{
|
2000-11-09 16:52:17 +00:00
|
|
|
GtkTreeViewColumn *retval;
|
2000-10-05 01:04:57 +00:00
|
|
|
va_list args;
|
|
|
|
|
|
|
|
retval = gtk_tree_view_column_new ();
|
|
|
|
|
2000-11-09 16:52:17 +00:00
|
|
|
gtk_tree_view_column_set_title (retval, title);
|
2001-09-25 19:38:18 +00:00
|
|
|
gtk_tree_view_column_pack_start (retval, cell, TRUE);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
va_start (args, cell);
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_set_attributesv (retval, cell, args);
|
2000-10-05 01:04:57 +00:00
|
|
|
va_end (args);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
/**
|
2001-08-24 20:09:26 +00:00
|
|
|
* gtk_tree_view_column_pack_start:
|
2001-06-27 23:44:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @cell: The #GtkCellRenderer.
|
2003-09-30 21:02:05 +00:00
|
|
|
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-09-30 21:02:05 +00:00
|
|
|
* Packs the @cell into the beginning of the column. If @expand is %FALSE, then
|
2002-09-28 20:03:56 +00:00
|
|
|
* the @cell is allocated no more space than it needs. Any unused space is divided
|
2003-09-30 21:02:05 +00:00
|
|
|
* evenly between cells for which @expand is %TRUE.
|
2001-06-27 23:44:53 +00:00
|
|
|
**/
|
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
2001-09-08 00:56:30 +00:00
|
|
|
gboolean expand)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (tree_column), cell, expand);
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_pack_end:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @cell: The #GtkCellRenderer.
|
2003-09-30 21:02:05 +00:00
|
|
|
* @expand: %TRUE if @cell is to be given extra space allocated to @tree_column.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-09-30 21:02:05 +00:00
|
|
|
* Adds the @cell to end of the column. If @expand is %FALSE, then the @cell
|
2002-09-28 20:03:56 +00:00
|
|
|
* is allocated no more space than it needs. Any unused space is divided
|
2003-09-30 21:02:05 +00:00
|
|
|
* evenly between cells for which @expand is %TRUE.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
gtk_tree_view_column_pack_end (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell,
|
2001-09-08 00:56:30 +00:00
|
|
|
gboolean expand)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (tree_column), cell, expand);
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_clear:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Unsets all the mappings on all renderers on the @tree_column.
|
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
void
|
2001-08-24 20:09:26 +00:00
|
|
|
gtk_tree_view_column_clear (GtkTreeViewColumn *tree_column)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_clear (GTK_CELL_LAYOUT (tree_column));
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_add_attribute:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-09-08 06:24:46 +00:00
|
|
|
* @cell_renderer: the #GtkCellRenderer to set attributes on
|
|
|
|
* @attribute: An attribute on the renderer
|
2000-10-16 06:14:53 +00:00
|
|
|
* @column: The column position on the model to get the attribute from.
|
|
|
|
*
|
|
|
|
* Adds an attribute mapping to the list in @tree_column. The @column is the
|
2001-09-08 06:24:46 +00:00
|
|
|
* column of the model to get a value from, and the @attribute is the
|
|
|
|
* parameter on @cell_renderer to be set from the value. So for example
|
|
|
|
* if column 2 of the model contains strings, you could have the
|
|
|
|
* "text" attribute of a #GtkCellRendererText get its values from
|
|
|
|
* column 2.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_add_attribute (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-02-17 00:16:08 +00:00
|
|
|
const gchar *attribute,
|
2000-10-05 01:04:57 +00:00
|
|
|
gint column)
|
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
cell_renderer, attribute, column);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2000-10-05 01:04:57 +00:00
|
|
|
va_list args)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
2000-10-05 01:04:57 +00:00
|
|
|
gchar *attribute;
|
|
|
|
gint column;
|
|
|
|
|
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (priv->cell_area),
|
2010-11-28 18:01:49 +00:00
|
|
|
cell_renderer);
|
2001-01-11 17:59:40 +00:00
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
while (attribute != NULL)
|
|
|
|
{
|
|
|
|
column = va_arg (args, gint);
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (priv->cell_area),
|
2010-11-28 18:01:49 +00:00
|
|
|
cell_renderer, attribute, column);
|
2000-10-05 01:04:57 +00:00
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_attributes:
|
2011-09-26 00:58:59 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2001-09-08 06:24:46 +00:00
|
|
|
* @cell_renderer: the #GtkCellRenderer we're setting the attributes of
|
2011-09-26 00:58:59 +00:00
|
|
|
* @...: A %NULL-terminated list of attributes
|
|
|
|
*
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
* Sets the attributes in the list as the attributes of @tree_column.
|
|
|
|
* The attributes should be in attribute/column order, as in
|
2001-12-08 21:39:34 +00:00
|
|
|
* gtk_tree_view_column_add_attribute(). All existing attributes
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
* are removed, and replaced with the new attributes.
|
2011-09-26 00:58:59 +00:00
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2000-10-05 01:04:57 +00:00
|
|
|
...)
|
|
|
|
{
|
|
|
|
va_list args;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-06-27 23:44:53 +00:00
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell_renderer));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
va_start (args, cell_renderer);
|
|
|
|
gtk_tree_view_column_set_attributesv (tree_column, cell_renderer, args);
|
2000-10-05 01:04:57 +00:00
|
|
|
va_end (args);
|
|
|
|
}
|
|
|
|
|
2001-02-17 00:16:08 +00:00
|
|
|
|
|
|
|
/**
|
2001-02-21 19:59:23 +00:00
|
|
|
* gtk_tree_view_column_set_cell_data_func:
|
2001-02-17 00:16:08 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2001-10-03 04:44:13 +00:00
|
|
|
* @cell_renderer: A #GtkCellRenderer
|
2011-01-18 08:25:47 +00:00
|
|
|
* @func: (allow-none): The #GtkTreeViewColumnFunc to use.
|
2001-02-17 00:16:08 +00:00
|
|
|
* @func_data: The user data for @func.
|
|
|
|
* @destroy: The destroy notification for @func_data
|
|
|
|
*
|
2001-09-08 06:24:46 +00:00
|
|
|
* Sets the #GtkTreeViewColumnFunc to use for the column. This
|
|
|
|
* function is used instead of the standard attributes mapping for
|
|
|
|
* setting the column value, and should set the value of @tree_column's
|
2001-12-08 21:39:34 +00:00
|
|
|
* cell renderer as appropriate. @func may be %NULL to remove an
|
2001-09-08 06:24:46 +00:00
|
|
|
* older one.
|
2001-02-17 00:16:08 +00:00
|
|
|
**/
|
|
|
|
void
|
2001-06-01 22:57:30 +00:00
|
|
|
gtk_tree_view_column_set_cell_data_func (GtkTreeViewColumn *tree_column,
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkCellRenderer *cell_renderer,
|
2001-06-01 22:57:30 +00:00
|
|
|
GtkTreeCellDataFunc func,
|
|
|
|
gpointer func_data,
|
2008-06-18 09:12:32 +00:00
|
|
|
GDestroyNotify destroy)
|
2001-02-17 00:16:08 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
cell_renderer,
|
|
|
|
(GtkCellLayoutDataFunc)func,
|
|
|
|
func_data, destroy);
|
2001-02-17 00:16:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-01-11 17:59:40 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_clear_attributes:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2001-12-08 21:39:34 +00:00
|
|
|
* @cell_renderer: a #GtkCellRenderer to clear the attribute mapping on.
|
2001-01-11 17:59:40 +00:00
|
|
|
*
|
|
|
|
* Clears all existing attributes previously set with
|
|
|
|
* gtk_tree_view_column_set_attributes().
|
|
|
|
**/
|
|
|
|
void
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer)
|
2001-01-11 17:59:40 +00:00
|
|
|
{
|
2003-07-11 12:51:24 +00:00
|
|
|
gtk_cell_layout_clear_attributes (GTK_CELL_LAYOUT (tree_column),
|
|
|
|
cell_renderer);
|
2002-06-07 22:02:23 +00:00
|
|
|
}
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_spacing:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @spacing: distance between cell renderers in pixels.
|
|
|
|
*
|
|
|
|
* Sets the spacing field of @tree_column, which is the number of pixels to
|
|
|
|
* place between cell renderers packed into it.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_spacing (GtkTreeViewColumn *tree_column,
|
|
|
|
gint spacing)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (spacing >= 0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
gtk_cell_area_box_set_spacing (GTK_CELL_AREA_BOX (priv->cell_area),
|
2010-11-28 18:01:49 +00:00
|
|
|
spacing);
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->tree_view)
|
2002-02-19 18:21:50 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
2001-06-30 02:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_spacing:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the spacing of @tree_column.
|
2001-12-08 21:39:34 +00:00
|
|
|
*
|
|
|
|
* Return value: the spacing of @tree_column.
|
2001-06-30 02:38:17 +00:00
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-06-30 02:38:17 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
return gtk_cell_area_box_get_spacing (GTK_CELL_AREA_BOX (priv->cell_area));
|
2001-06-30 02:38:17 +00:00
|
|
|
}
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
/* Options for manipulating the columns */
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_visible:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @visible: %TRUE if the @tree_column is visible.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Sets the visibility of @tree_column.
|
2011-02-03 04:54:38 +00:00
|
|
|
*/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
|
2011-02-03 04:54:38 +00:00
|
|
|
gboolean visible)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
Adapt to GtkTreeSelection changes
2001-01-01 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeview.c: Adapt to GtkTreeSelection changes
* gtk/gtktreeselection.c (_gtk_tree_selection_set_tree_view):
don't fill in tree_view->priv->selection, kind of an unexpected
side effect
* gtk/gtkcellrenderertext.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderer.c: Remove definition of _ and include
gtkintl.h
(gtk_cell_renderer_get_property): remove calls to g_value_init
* gtk/gtkcellrendererpixbuf.c: Remove definition of _ and include
gtkintl.h
* gtk/gtkcellrenderertextpixbuf.c: Remove definition of _ macro
and include gtkintl.h
(gtk_cell_renderer_text_pixbuf_class_init): remove spaces from
property names
* gtk/gtktreeselection.c (_gtk_tree_selection_new): rename, return
GtkTreeSelection
(_gtk_tree_selection_new_from_with_view): rename, return
GtkTreeSelection
(_gtk_tree_selection_set_tree_view): rename with uscore
(gtk_tree_selection_get_selected): fill in the "model" out param
first, so it gets filled in even if we return at the top of the
function
(gtk_tree_selection_real_select_all): add a comment and an else{}
to clarify this a bit
(gtk_tree_selection_real_unselect_all): add the same else{}
* gtk/gtktreeselection.h: Rename new, new_with_tree_view, and
set_tree_view to have underscore prefixes, move them to the
private header, fix return type of new_with_tree_view
(struct _GtkTreeSelection): mark struct
fields private
* gtk/gtktreemodel.c (gtk_tree_model_get_flags): return
GtkTreeModelFlags, not a guint
(gtk_tree_path_prev): return gboolean not gint
(gtk_tree_path_up): return gboolean not gint
* gtk/gtktreemodel.h (struct _GtkTreeModelIface): make get_flags
return GtkTreeModelFlags, not a guint
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_finalize): check
that child model is non-null before unrefing it
(g_value_int_compare_func): make this a qsort compare func, not
a boolean predicate
* gtk/gtktreemodelsort.h: rename gtk_tree_model_set_sort_column,
(add -umn to the end), and mark it unimplemented
(gtk_tree_model_sort_resort): remove, this wasn't implemented, and
I don't see what it's for - doesn't the model always sort itself?
(gtk_tree_model_sort_set_compare): this had the wrong signature
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_set_attributes):
Fix the docs to say that it destructively replaces existing
attributes (previously said that it added attributes).
(gtk_tree_view_column_set_visible): canonicalize bool before
equality testing. Also, check for realization before
hiding/showing the tree_column->window; if this window could exist
before realization, then it's busted and needs fixing, we can't
create GDK resources pre-realization. Also, remove
superfluous queue_resize(), since set_size() does that for us.
(gtk_tree_view_column_set_col_type): check realization before
using tree_column->window
* gtk/gtktreedatalist.c: fix filename in copyright notice
2001-01-01 19:01:54 +00:00
|
|
|
visible = !! visible;
|
2011-02-03 04:54:38 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible == visible)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->visible = visible;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible)
|
2002-02-25 21:20:25 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
|
2011-02-03 04:54:38 +00:00
|
|
|
if (priv->tree_view)
|
2011-11-16 02:47:33 +00:00
|
|
|
{
|
|
|
|
_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);
|
|
|
|
}
|
2011-01-12 20:18:07 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "visible");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_visible:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Returns %TRUE if @tree_column is visible.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Return value: whether the column is visible or not. If it is visible, then
|
|
|
|
* the tree will show the column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->visible;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_resizable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
* @resizable: %TRUE, if the column can be resized
|
|
|
|
*
|
|
|
|
* If @resizable is %TRUE, then the user can explicitly resize the column by
|
2004-01-31 21:42:28 +00:00
|
|
|
* grabbing the outer edge of the column button. If resizable is %TRUE and
|
2002-03-05 23:08:56 +00:00
|
|
|
* sizing mode of the column is #GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the sizing
|
|
|
|
* mode is changed to #GTK_TREE_VIEW_COLUMN_GROW_ONLY.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-11-19 21:18:22 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean resizable)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
2001-11-19 21:18:22 +00:00
|
|
|
resizable = !! resizable;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->resizable == resizable)
|
2001-11-19 21:18:22 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->resizable = resizable;
|
2001-12-04 23:49:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (resizable && priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
2001-11-19 21:18:22 +00:00
|
|
|
gtk_tree_view_column_set_sizing (tree_column, GTK_TREE_VIEW_COLUMN_GROW_ONLY);
|
|
|
|
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "resizable");
|
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_resizable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Returns %TRUE if the @tree_column can be resized by the end user.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Return value: %TRUE, if the @tree_column can be resized.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-11-19 21:18:22 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->resizable;
|
2001-11-19 21:18:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-01-04 21:33:24 +00:00
|
|
|
* gtk_tree_view_column_set_sizing:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-01-04 21:33:24 +00:00
|
|
|
* @type: The #GtkTreeViewColumnSizing.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Sets the growth behavior of @tree_column to @type.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_sizing (GtkTreeViewColumn *tree_column,
|
2001-01-09 23:24:20 +00:00
|
|
|
GtkTreeViewColumnSizing type)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
if (type == priv->column_type)
|
2000-10-05 01:04:57 +00:00
|
|
|
return;
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
if (type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
gtk_tree_view_column_set_resizable (tree_column, FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->column_type = type;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "sizing");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-01-09 23:24:20 +00:00
|
|
|
* gtk_tree_view_column_get_sizing:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the current type of @tree_column.
|
|
|
|
*
|
|
|
|
* Return value: The type of @tree_column.
|
|
|
|
**/
|
2001-06-05 19:01:30 +00:00
|
|
|
GtkTreeViewColumnSizing
|
2001-01-09 23:24:20 +00:00
|
|
|
gtk_tree_view_column_get_sizing (GtkTreeViewColumn *tree_column)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->column_type;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
* gtk_tree_view_column_get_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Returns the current size of @tree_column in pixels.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Return value: The current width of @tree_column.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gint
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_get_width (GtkTreeViewColumn *tree_column)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->width;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_x_offset:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the current X offset of @tree_column in pixels.
|
|
|
|
*
|
|
|
|
* Return value: The current X offset of @tree_column.
|
|
|
|
*
|
|
|
|
* Since: 3.2
|
|
|
|
*/
|
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_x_offset (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
|
|
return tree_column->priv->x_offset;
|
|
|
|
}
|
|
|
|
|
2010-12-01 03:41:42 +00:00
|
|
|
gint
|
|
|
|
_gtk_tree_view_column_request_width (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
gint real_requested_width;
|
|
|
|
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
if (priv->use_resized_width)
|
|
|
|
{
|
|
|
|
real_requested_width = priv->resized_width;
|
|
|
|
}
|
|
|
|
else if (priv->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
|
|
|
|
{
|
|
|
|
real_requested_width = priv->fixed_width;
|
|
|
|
}
|
|
|
|
else if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
|
|
|
|
{
|
|
|
|
gint button_request;
|
2010-12-06 07:31:07 +00:00
|
|
|
gint requested_width;
|
|
|
|
|
|
|
|
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
|
|
|
|
requested_width += priv->padding;
|
2010-12-01 03:41:42 +00:00
|
|
|
|
|
|
|
gtk_widget_get_preferred_width (priv->button, &button_request, NULL);
|
2010-12-06 07:31:07 +00:00
|
|
|
real_requested_width = MAX (requested_width, button_request);
|
2010-12-01 03:41:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-12-06 07:31:07 +00:00
|
|
|
gint requested_width;
|
|
|
|
|
|
|
|
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &requested_width, NULL);
|
|
|
|
requested_width += priv->padding;
|
|
|
|
|
|
|
|
real_requested_width = requested_width;
|
2010-12-01 03:41:42 +00:00
|
|
|
if (real_requested_width < 0)
|
|
|
|
real_requested_width = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (priv->min_width != -1)
|
|
|
|
real_requested_width = MAX (real_requested_width, priv->min_width);
|
|
|
|
|
|
|
|
if (priv->max_width != -1)
|
|
|
|
real_requested_width = MIN (real_requested_width, priv->max_width);
|
|
|
|
|
|
|
|
return real_requested_width;
|
|
|
|
}
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
void
|
2010-12-01 03:23:02 +00:00
|
|
|
_gtk_tree_view_column_allocate (GtkTreeViewColumn *tree_column,
|
|
|
|
int x_offset,
|
2010-12-06 07:31:07 +00:00
|
|
|
int width)
|
2010-11-28 18:01:49 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2010-12-01 03:23:02 +00:00
|
|
|
gboolean rtl;
|
2011-09-28 22:27:35 +00:00
|
|
|
GtkAllocation allocation = { 0, 0, 0, 0 };
|
2010-11-30 05:29:45 +00:00
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2011-04-05 19:13:43 +00:00
|
|
|
if (priv->width != width)
|
|
|
|
gtk_widget_queue_draw (priv->tree_view);
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
priv->x_offset = x_offset;
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->width = width;
|
2010-11-29 09:04:47 +00:00
|
|
|
|
2010-12-06 07:31:07 +00:00
|
|
|
gtk_cell_area_context_allocate (priv->cell_area_context, priv->width - priv->padding, -1);
|
2010-12-01 03:23:02 +00:00
|
|
|
|
2011-06-09 22:55:19 +00:00
|
|
|
if (gtk_tree_view_get_headers_visible (GTK_TREE_VIEW (priv->tree_view)))
|
|
|
|
{
|
|
|
|
allocation.x = x_offset;
|
|
|
|
allocation.y = 0;
|
|
|
|
allocation.width = width;
|
|
|
|
allocation.height = _gtk_tree_view_get_header_height (GTK_TREE_VIEW (priv->tree_view));
|
2010-12-01 03:23:02 +00:00
|
|
|
|
2011-06-09 22:55:19 +00:00
|
|
|
gtk_widget_size_allocate (priv->button, &allocation);
|
|
|
|
}
|
2010-12-01 03:23:02 +00:00
|
|
|
|
|
|
|
if (priv->window)
|
|
|
|
{
|
|
|
|
rtl = (gtk_widget_get_direction (priv->tree_view) == GTK_TEXT_DIR_RTL);
|
|
|
|
gdk_window_move_resize (priv->window,
|
|
|
|
allocation.x + (rtl ? 0 : allocation.width) - TREE_VIEW_DRAG_WIDTH/2,
|
|
|
|
allocation.y,
|
|
|
|
TREE_VIEW_DRAG_WIDTH, allocation.height);
|
|
|
|
}
|
|
|
|
|
2011-06-10 04:09:25 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "x-offset");
|
2010-11-29 09:04:47 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "width");
|
2010-11-28 18:01:49 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
* gtk_tree_view_column_set_fixed_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @fixed_width: The size to set @tree_column to. Must be greater than 0.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
2001-09-08 00:56:30 +00:00
|
|
|
* Sets the size of the column in pixels. This is meaningful only if the sizing
|
2002-03-05 23:22:27 +00:00
|
|
|
* type is #GTK_TREE_VIEW_COLUMN_FIXED. The size of the column is clamped to
|
|
|
|
* the min/max width for the column. Please note that the min/max width of the
|
|
|
|
* column doesn't actually affect the "fixed_width" property of the widget, just
|
|
|
|
* the actual size when displayed.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_set_fixed_width (GtkTreeViewColumn *tree_column,
|
2001-10-03 04:44:13 +00:00
|
|
|
gint fixed_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-10-03 13:33:50 +00:00
|
|
|
g_return_if_fail (fixed_width > 0);
|
2001-03-05 19:43:24 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
priv->fixed_width = fixed_width;
|
|
|
|
priv->use_resized_width = FALSE;
|
2001-12-04 23:49:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->tree_view &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view) &&
|
|
|
|
priv->column_type == GTK_TREE_VIEW_COLUMN_FIXED)
|
2001-12-04 23:49:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-12-04 23:49:57 +00:00
|
|
|
}
|
2002-01-28 18:52:49 +00:00
|
|
|
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "fixed-width");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
/**
|
2001-09-08 00:56:30 +00:00
|
|
|
* gtk_tree_view_column_get_fixed_width:
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
2001-12-04 23:49:57 +00:00
|
|
|
* Gets the fixed width of the column. This value is only meaning may not be
|
|
|
|
* the actual width of the column on the screen, just what is requested.
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
*
|
2001-09-08 00:56:30 +00:00
|
|
|
* Return value: the fixed width of the column
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
**/
|
|
|
|
gint
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_get_fixed_width (GtkTreeViewColumn *tree_column)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->fixed_width;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_min_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @min_width: The minimum width of the column in pixels, or -1.
|
|
|
|
*
|
|
|
|
* Sets the minimum width of the @tree_column. If @min_width is -1, then the
|
|
|
|
* minimum width is unset.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_min_width (GtkTreeViewColumn *tree_column,
|
|
|
|
gint min_width)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (min_width >= -1);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
if (min_width == priv->min_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible &&
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
if (min_width > priv->width)
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->min_width = min_width;
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (tree_column));
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->max_width != -1 && priv->max_width < min_width)
|
2001-12-04 23:49:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->max_width = min_width;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "max-width");
|
2001-12-04 23:49:57 +00:00
|
|
|
}
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "min-width");
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_thaw_notify (G_OBJECT (tree_column));
|
2002-04-19 23:41:37 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (priv->tree_view),
|
2002-04-19 23:41:37 +00:00
|
|
|
tree_column);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_min_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the minimum width in pixels of the @tree_column, or -1 if no minimum
|
|
|
|
* width is set.
|
|
|
|
*
|
|
|
|
* Return value: The minimum width of the @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_min_width (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->min_width;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_max_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @max_width: The maximum width of the column in pixels, or -1.
|
|
|
|
*
|
|
|
|
* Sets the maximum width of the @tree_column. If @max_width is -1, then the
|
2001-08-24 20:09:26 +00:00
|
|
|
* maximum width is unset. Note, the column can actually be wider than max
|
|
|
|
* width if it's the last column in a view. In this case, the column expands to
|
2001-12-04 23:49:57 +00:00
|
|
|
* fill any extra space.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_max_width (GtkTreeViewColumn *tree_column,
|
|
|
|
gint max_width)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (max_width >= -1);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
if (max_width == priv->max_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible &&
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-06-05 15:30:53 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
if (max_width != -1 && max_width < priv->width)
|
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-06-05 15:30:53 +00:00
|
|
|
}
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->max_width = max_width;
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (tree_column));
|
2010-11-30 05:29:45 +00:00
|
|
|
if (max_width != -1 && max_width < priv->min_width)
|
2001-12-04 23:49:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->min_width = max_width;
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "min-width");
|
2001-12-04 23:49:57 +00:00
|
|
|
}
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "max-width");
|
2002-01-28 18:52:49 +00:00
|
|
|
g_object_thaw_notify (G_OBJECT (tree_column));
|
2002-04-19 23:41:37 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
_gtk_tree_view_column_autosize (GTK_TREE_VIEW (priv->tree_view),
|
2002-04-19 23:41:37 +00:00
|
|
|
tree_column);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_max_width:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the maximum width in pixels of the @tree_column, or -1 if no maximum
|
|
|
|
* width is set.
|
|
|
|
*
|
|
|
|
* Return value: The maximum width of the @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_max_width (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), -1);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->max_width;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_clicked:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
2001-05-16 00:23:30 +00:00
|
|
|
* Emits the "clicked" signal on the column. This function will only work if
|
2001-12-04 23:49:57 +00:00
|
|
|
* @tree_column is clickable.
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
Port to GObject, can go back in gdk-pixbuf after setting up a
2000-12-16 Havoc Pennington <hp@pobox.com>
* gtk/gdk-pixbuf-loader.h, gtk/gdk-pixbuf-loader.c:
Port to GObject, can go back in gdk-pixbuf after setting up
a gdk-pixbuf-marshal.h header over there.
* gtk/gtktreeview.c: s/SEPERATOR/SEPARATOR/g;
(gtk_tree_view_class_init): specify GTK_TYPE_ADJUSTMENT for signal
args
(gtk_tree_view_init): don't unset GTK_NO_WINDOW, it shouldn't be
set
(gtk_tree_view_realize_buttons): don't gtk_widget_show() buttons
here, do it when we create the buttons later
(gtk_tree_view_realize_buttons): add some g_return_if_fail
(gtk_tree_view_map): paranoia checks that column->button is shown
and unmapped
(gtk_tree_view_size_request): only request visible children.
Move header size calculation in here, for cleanliness, and
to maintain invariants for child widgets if we eventually
let users set different children inside the buttons
(gtk_tree_view_map_buttons): factor out code to map buttons,
since it was being called several times
(gtk_tree_view_size_allocate_buttons): move_resize the drag
windows instead of just moving them; their height may change
if we allow random widgets in there, or the theme changes.
(gtk_tree_view_size_allocate): move button size allocation
above emitting the scroll signals, to ensure a sane state when we
hit user code
(gtk_tree_view_button_release): remove queue_resize after
tree_view_set_size(), set_size() will handle any resize queuing
that's needed
(gtk_tree_view_focus_in): just queue a draw, don't fool with
draw_focus goo
(gtk_tree_view_focus): use gtk_get_current_event() and
gdk_event_get_state()
(gtk_tree_view_deleted): don't queue_resize() after calling set_size()
(gtk_tree_view_build_tree): fix a "if (foo); {}" bug - i.e. remove
semicolon
(gtk_tree_view_create_button): show the button here
(gtk_tree_view_button_clicked): actually emit the clicked signal
on the column
(_gtk_tree_view_set_size): return right away if the size is
unchanged, as a cheesy optimization
(gtk_tree_view_setup_model): rename set_model_realized to
setup_model to match the flag that indicates whether we've
called it
(gtk_tree_view_get_hadjustment): create adjustment if it doesn't
exist, because set_scroll_adjustment does that and it shouldn't
matter what order you call these in
(gtk_tree_view_get_vadjustment): ditto
(gtk_tree_view_set_headers_visible): canonicalize the bool,
for paranoia
(gtk_tree_view_set_headers_visible): call
gtk_tree_view_map_buttons() instead of using cut-and-paste code
(gtk_tree_view_append_column): clarify whether the return value
is the count of columns before or after, and do the increment
separately from the return statement so you can tell from the code.
(gtk_tree_view_remove_column): ditto
(gtk_tree_view_insert_column): ditto
(gtk_tree_view_get_column): remove g_return_if_fail for columns
outside the existing range, the docs say that outside-range
columns are allowed, so we handle them as documented. (Presumably
this allows a nice loop with column != NULL as test.)
(gtk_tree_view_move_to): document what 0.0, 0.5, 1.0 alignments
mean (left/right/center etc.).
(gtk_tree_view_collapse_all): only queue a draw if we're mapped
(gtk_tree_view_expand_row): add docs
(gtk_tree_view_collapse_row): add docs
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clicked): new
function to emit the clicked signal on a column
* gdk/gdkevents.c (gdk_event_get_state): new function, to get the
state of an event
(gdk_event_get_time): don't treat GDK_SCROLL
as a button event, remove default case from switch so gcc
will whine if we don't explicitly handle all event types
* gtk/gtktreeselection.h: added some FIXME
* gtk/gtktreeprivate.h (struct _GtkTreeViewPrivate): rename
"columns" to "n_columns" and "column" to "columns" for clarity
2000-12-17 23:50:00 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
if (priv->visible &&
|
|
|
|
priv->button &&
|
|
|
|
priv->clickable)
|
|
|
|
gtk_button_clicked (GTK_BUTTON (priv->button));
|
2001-01-19 22:39:19 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_title:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @title: The title of the @tree_column.
|
|
|
|
*
|
|
|
|
* Sets the title of the @tree_column. If a custom widget has been set, then
|
|
|
|
* this value is ignored.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_title (GtkTreeViewColumn *tree_column,
|
2001-02-21 19:59:23 +00:00
|
|
|
const gchar *title)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
gchar *new_title;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2003-11-07 21:57:20 +00:00
|
|
|
new_title = g_strdup (title);
|
2010-11-30 05:29:45 +00:00
|
|
|
g_free (priv->title);
|
|
|
|
priv->title = new_title;
|
2000-10-16 06:14:53 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "title");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_title:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
* Returns the title of the widget.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
Minor documentation fixes
2002-08-10 Soren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tree_widget.sgml,
docs/reference/gtk/tmpl/gtkdialog.sgml,
docs/reference/gtk/tmpl/gtkentry.sgml,
docs/reference/gtk/tmpl/gtkfilesel.sgml,
docs/reference/gtk/tmpl/gtkfontsel.sgml,
docs/reference/gtk/tmpl/gtkfontseldlg.sgml,
docs/reference/gtk/tmpl/gtktreemodel.sgml,
docs/reference/gtk/tmpl/gtkwidget.sgml, gdk/x11/gdkdisplay-x11.c,
gtk/gtkbbox.c, gtk/gtkbox.c, gtk/gtkbutton.c, gtk/gtkcellrenderer.c,
gtk/gtkcellrendererpixbuf.c, gtk/gtkcellrenderertext.c,
gtk/gtkcheckmenuitem.c, gtk/gtkcontainer.c, gtk/gtkcurve.c,
gtk/gtkdialog.h, gtk/gtkentry.c, gtk/gtkfilesel.c, gtk/gtkfontsel.c,
gtk/gtkframe.c, gtk/gtkhandlebox.c, gtk/gtkiconfactory.c,
gtk/gtkimage.c, gtk/gtkinvisible.c, gtk/gtkitemfactory.c,
gtk/gtklabel.c, gtk/gtklayout.c, gtk/gtkmenu.c, gtk/gtkprogress.c,
gtk/gtkprogressbar.c, gtk/gtkscrolledwindow.c, gtk/gtksizegroup.c,
gtk/gtktable.c, gtk/gtktextiter.c, gtk/gtktexttag.c,
gtk/gtktexttag.h, gtk/gtktextview.c, gtk/gtktogglebutton.c,
gtk/gtktoolbar.c, gtk/gtktreemodel.c, gtk/gtktreeselection.c,
gtk/gtktreestore.c, gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c,
gtk/gtkviewport.c, gtk/gtkwidget.c, gtk/gtkwidget.h,
gtk/gtkwindow.c:
Minor documentation fixes
(#89254, patch from Brett Nash;
#85809, patch from daten@dnetc.org;
#76391, patch from Ross Burton;
#74559, Manuel Clos;
#73569, #72005, Alexey A. Malyshev;
#70061, patch from Dennis Bj"orklund;
#64566, #63388, #58328, #57499, #81007, #77349, Vitaly Tishkov;
#78932, Vitaly Tishkov, patch from Ross Burton;
#73306)
2002-08-10 09:55:41 +00:00
|
|
|
* Return value: the title of the column. This string should not be
|
|
|
|
* modified or freed.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2011-06-06 18:13:44 +00:00
|
|
|
const gchar *
|
2000-10-05 01:04:57 +00:00
|
|
|
gtk_tree_view_column_get_title (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->title;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_expand:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2005-06-10 04:45:40 +00:00
|
|
|
* @expand: %TRUE if the column should take available extra space, %FALSE if not
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
*
|
|
|
|
* Sets the column to take available extra space. This space is shared equally
|
|
|
|
* amongst all columns that have the expand set to %TRUE. If no column has this
|
|
|
|
* option set, then the last column gets all extra space. By default, every
|
|
|
|
* column is created with this %FALSE.
|
2003-04-12 22:25:21 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_expand (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean expand)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
expand = expand?TRUE:FALSE;
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->expand == expand)
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
return;
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->expand = expand;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->visible &&
|
|
|
|
priv->tree_view != NULL &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
{
|
2008-07-11 14:17:49 +00:00
|
|
|
/* We want to continue using the original width of the
|
|
|
|
* column that includes additional space added by the user
|
|
|
|
* resizing the columns and possibly extra (expanded) space, which
|
|
|
|
* are not included in the resized width.
|
|
|
|
*/
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->use_resized_width = FALSE;
|
2008-07-11 14:17:49 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "expand");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_expand:
|
2005-06-10 04:45:40 +00:00
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
*
|
|
|
|
* Return %TRUE if the column expands to take any available space.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE, if the column expands
|
2003-04-12 22:25:21 +00:00
|
|
|
*
|
|
|
|
* Since: 2.4
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_expand (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->expand;
|
handle rtl code.
Sun Mar 2 23:35:57 2003 Jonathan Blandford <jrb@gnome.org>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_get_size):
handle rtl code.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_get_size): ditto
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_get_size): ditto
* gtk/gtktreeview.c: (invalidate_column),
(invalidate_last_column),
(gtk_tree_view_get_real_requested_width_from_column),
(gtk_tree_view_size_allocate_columns),
(gtk_tree_view_size_allocate), (gtk_tree_view_button_press),
(gtk_tree_view_button_release_drag_column),
(gtk_tree_view_update_current_reorder),
(gtk_tree_view_motion_drag_column), (gtk_tree_view_bin_expose),
(gtk_tree_view_key_press), (gtk_tree_view_header_focus),
(gtk_tree_view_get_background_xrange),
(gtk_tree_view_get_arrow_xrange),
(gtk_tree_view_is_expander_column),
(gtk_tree_view_set_column_drag_info),
(gtk_tree_view_move_cursor_left_right):
Add RTL support.
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): add an
expand flag.
* gtk/gtktreeviewcolumn.c:
(gtk_tree_view_column_class_init),
(gtk_tree_view_column_set_property),
(gtk_tree_view_column_get_property),
(gtk_tree_view_column_set_expand),
(gtk_tree_view_column_get_expand),
(gtk_tree_view_column_cell_process_action):
Add support for expand flag
2003-03-03 04:51:42 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_clickable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @clickable: %TRUE if the header is active.
|
2001-05-16 00:23:30 +00:00
|
|
|
*
|
2012-02-10 13:58:59 +00:00
|
|
|
* Sets the header to be active if @clickable is %TRUE. When the header is
|
|
|
|
* active, then it can take keyboard focus, and can be clicked.
|
2001-05-16 00:23:30 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean clickable)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2001-12-04 23:49:57 +00:00
|
|
|
clickable = !! clickable;
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->clickable == clickable)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->clickable = clickable;
|
2001-05-22 19:18:47 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "clickable");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_clickable:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Returns %TRUE if the user can click on the header for the column.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Return value: %TRUE if user can click the column header.
|
2001-01-09 23:24:20 +00:00
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->clickable;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_widget:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2009-12-10 10:23:40 +00:00
|
|
|
* @widget: (allow-none): A child #GtkWidget, or %NULL.
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Sets the widget in the header to be @widget. If widget is %NULL, then the
|
2000-10-16 06:14:53 +00:00
|
|
|
* header button is set with a #GtkLabel set to the title of @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_widget (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkWidget *widget)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-01-19 22:39:19 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
if (widget)
|
2005-11-23 18:06:58 +00:00
|
|
|
g_object_ref_sink (widget);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->child)
|
|
|
|
g_object_unref (priv->child);
|
2001-01-19 22:39:19 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->child = widget;
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "widget");
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_widget:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2010-09-21 04:18:11 +00:00
|
|
|
*
|
|
|
|
* Returns the #GtkWidget in the button on the column header.
|
|
|
|
* If a custom widget has not been set then %NULL is returned.
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): The #GtkWidget in the column
|
|
|
|
* header, or %NULL
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
GtkWidget *
|
|
|
|
gtk_tree_view_column_get_widget (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->child;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
* gtk_tree_view_column_set_alignment:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-10-06 00:50:36 +00:00
|
|
|
* @xalign: The alignment, which is between [0.0 and 1.0] inclusive.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
* Sets the alignment of the title or custom widget inside the column header.
|
2001-10-06 00:50:36 +00:00
|
|
|
* The alignment determines its location inside the button -- 0.0 for left, 0.5
|
|
|
|
* for center, 1.0 for right.
|
2000-10-16 06:14:53 +00:00
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
gtk_tree_view_column_set_alignment (GtkTreeViewColumn *tree_column,
|
|
|
|
gfloat xalign)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2001-09-25 19:38:18 +00:00
|
|
|
xalign = CLAMP (xalign, 0.0, 1.0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->xalign == xalign)
|
2000-10-05 01:04:57 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->xalign = xalign;
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "alignment");
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-05 15:30:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_alignment:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the current x alignment of @tree_column. This value can range
|
|
|
|
* between 0.0 and 1.0.
|
|
|
|
*
|
|
|
|
* Return value: The current alignent of @tree_column.
|
|
|
|
**/
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
gfloat
|
|
|
|
gtk_tree_view_column_get_alignment (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0.5);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->xalign;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_reorderable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
2003-04-12 22:25:21 +00:00
|
|
|
* @reorderable: %TRUE, if the column can be reordered.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* If @reorderable is %TRUE, then the column can be reordered by the end user
|
2002-02-23 07:05:55 +00:00
|
|
|
* dragging the header.
|
|
|
|
**/
|
2001-05-16 00:23:30 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_reorderable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean reorderable)
|
2001-03-29 21:30:05 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
/* if (reorderable)
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);*/
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->reorderable == (reorderable?TRUE:FALSE))
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->reorderable = (reorderable?TRUE:FALSE);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "reorderable");
|
2001-03-29 21:30:05 +00:00
|
|
|
}
|
2001-03-28 01:54:14 +00:00
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_reorderable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Returns %TRUE if the @tree_column can be reordered by the user.
|
2002-02-23 07:05:55 +00:00
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Return value: %TRUE if the @tree_column can be reordered by the user.
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-05-16 00:23:30 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_reorderable (GtkTreeViewColumn *tree_column)
|
2001-03-28 01:54:14 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->reorderable;
|
2001-03-28 01:54:14 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2001-03-28 01:54:14 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_sort_column_id:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2001-12-08 21:39:34 +00:00
|
|
|
* @sort_column_id: The @sort_column_id of the model to sort on.
|
docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
Sat Oct 5 16:47:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
gdk/x11/gdkwindow-x11.c, gtk/gtkfontsel.h, gtk/gtkimcontext.c,
gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c
Documentation fixes:
#75170, Dan Winship;
#73220, Havoc Pennington;
#70742, Boris Shingarov;
#72007, Alexey A. Malyshev
2002-10-05 15:09:29 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Sets the logical @sort_column_id that this column sorts on when this column
|
|
|
|
* is selected for sorting. Doing so makes the column header clickable.
|
2001-03-28 01:54:14 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column,
|
|
|
|
gint sort_column_id)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-03-28 01:54:14 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2003-01-27 21:41:06 +00:00
|
|
|
g_return_if_fail (sort_column_id >= -1);
|
2001-03-28 01:54:14 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
if (priv->sort_column_id == sort_column_id)
|
2001-03-28 01:54:14 +00:00
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->sort_column_id = sort_column_id;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
/* Handle unsetting the id */
|
2001-03-28 01:54:14 +00:00
|
|
|
if (sort_column_id == -1)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->tree_view));
|
2003-01-27 21:41:06 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->sort_clicked_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_disconnect (tree_column, priv->sort_clicked_signal);
|
|
|
|
priv->sort_clicked_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->sort_column_changed_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_disconnect (model, priv->sort_column_changed_signal);
|
|
|
|
priv->sort_column_changed_signal = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2001-08-23 18:33:37 +00:00
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, FALSE);
|
2003-01-27 21:41:06 +00:00
|
|
|
gtk_tree_view_column_set_clickable (tree_column, FALSE);
|
2009-07-25 16:46:09 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-column-id");
|
2001-03-28 01:54:14 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (! priv->sort_clicked_signal)
|
|
|
|
priv->sort_clicked_signal = g_signal_connect (tree_column,
|
|
|
|
"clicked",
|
|
|
|
G_CALLBACK (gtk_tree_view_column_sort),
|
|
|
|
NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_setup_sort_column_id_callback (tree_column);
|
2009-07-25 16:46:09 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-column-id");
|
2001-03-28 01:54:14 +00:00
|
|
|
}
|
|
|
|
|
2001-06-24 15:34:48 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_sort_column_id:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Gets the logical @sort_column_id that the model sorts on when this
|
docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
Sat Oct 5 16:47:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* docs/reference/gtk/tmpl/gtkfontseldlg.sgml, gdk/gdkwindow.c,
gdk/x11/gdkwindow-x11.c, gtk/gtkfontsel.h, gtk/gtkimcontext.c,
gtk/gtktreeview.c, gtk/gtktreeviewcolumn.c
Documentation fixes:
#75170, Dan Winship;
#73220, Havoc Pennington;
#70742, Boris Shingarov;
#72007, Alexey A. Malyshev
2002-10-05 15:09:29 +00:00
|
|
|
* column is selected for sorting.
|
|
|
|
* See gtk_tree_view_column_set_sort_column_id().
|
2001-06-24 15:34:48 +00:00
|
|
|
*
|
2001-12-08 21:39:34 +00:00
|
|
|
* Return value: the current @sort_column_id for this column, or -1 if
|
2001-06-24 15:34:48 +00:00
|
|
|
* this column can't be used for sorting.
|
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->sort_column_id;
|
2001-06-24 15:34:48 +00:00
|
|
|
}
|
|
|
|
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_sort_indicator:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
* @setting: %TRUE to display an indicator that the column is sorted
|
|
|
|
*
|
|
|
|
* Call this function with a @setting of %TRUE to display an arrow in
|
|
|
|
* the header button indicating the column is sorted. Call
|
|
|
|
* gtk_tree_view_column_set_sort_order() to change the direction of
|
|
|
|
* the arrow.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_sort_indicator (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean setting)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
setting = setting != FALSE;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (setting == tree_column->priv->show_sort_indicator)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
tree_column->priv->show_sort_indicator = setting;
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-indicator");
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_sort_indicator:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Gets the value set by gtk_tree_view_column_set_sort_indicator().
|
|
|
|
*
|
|
|
|
* Return value: whether the sort indicator arrow is displayed
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->show_sort_indicator;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_sort_order:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
* @order: sort order that the sort indicator should indicate
|
|
|
|
*
|
2001-11-10 01:30:31 +00:00
|
|
|
* Changes the appearance of the sort indicator.
|
|
|
|
*
|
|
|
|
* This <emphasis>does not</emphasis> actually sort the model. Use
|
2001-03-28 01:54:14 +00:00
|
|
|
* gtk_tree_view_column_set_sort_column_id() if you want automatic sorting
|
|
|
|
* support. This function is primarily for custom sorting behavior, and should
|
2001-11-10 01:30:31 +00:00
|
|
|
* be used in conjunction with gtk_tree_sortable_set_sort_column() to do
|
|
|
|
* that. For custom models, the mechanism will vary.
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
*
|
2001-11-10 01:30:31 +00:00
|
|
|
* The sort indicator changes direction to indicate normal sort or reverse sort.
|
|
|
|
* Note that you must have the sort indicator enabled to see anything when
|
|
|
|
* calling this function; see gtk_tree_view_column_set_sort_indicator().
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_sort_order (GtkTreeViewColumn *tree_column,
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType order)
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (order == tree_column->priv->sort_order)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
tree_column->priv->sort_order = order;
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
2005-03-26 05:49:15 +00:00
|
|
|
g_object_notify (G_OBJECT (tree_column), "sort-order");
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_sort_order:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Gets the value set by gtk_tree_view_column_set_sort_order().
|
|
|
|
*
|
|
|
|
* Return value: the sort order the sort indicator is indicating
|
|
|
|
**/
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType
|
remove validation idle
2001-02-08 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c (gtk_text_view_destroy_layout): remove
validation idle
* demos/gtk-demo/main.c (create_tree): adjust to changes in text
cell renderer
* demos/pixbuf-demo.c (timeout): remove deprecated
gtk_widget_draw
* demos/testpixbuf-save.c (main): remove deprecated
gtk_drawing_area_size
* gtk/gtktreeview.c (gtk_tree_view_size_allocate): allocate
buttons even if the model isn't setup. gtk_tree_view_check_dirty()
at the start of the allocation.
(gtk_tree_view_check_dirty): handle column->button == NULL, handle
unsetup or NULL model.
* gtk/gtkstyle.c (gtk_default_draw_flat_box): drawing for the
even/odd/sorted cells in the tree view.
* gtk/gtktreeselection.c (gtk_tree_selection_real_unselect_all):
bugfixes
* gtk/gtktreeview.c: assorted bugfixy stuff. Draw the row
backgrounds with draw_flat_box using different detail for even/odd
rows.
* gtk/gtkrbtree.c, gtkrbtree.h: Keep track of the parity of each
row, so we can draw the alternating colors thing
* gtk/gtktexttag.c (gtk_text_tag_set_property): if we change a
property from a synonym property, notify for the synonym.
Also, nuke the background_gdk_set and foreground_gdk_set synonyms
(gtk_text_tag_get_property): Always return the font, even if
all its fields aren't set
* gtk/gtkcellrenderertext.h (struct _GtkCellRendererText): don't
store the attr list; it leaves us with no way to change attributes
in _render according to the render flags, and no way to implement
get_property. Instead store all the specific text attributes.
Separate whether an attribute is enabled from its value. Sync all
properties with GtkTextTag, make them all consistent, etc.
* gtk/gtkcellrenderer.h: Add a flag GTK_CELL_RENDERER_SORTED so
renderers can highlight the sort row/column
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_get_property): use
accessor functions to get values; this has the side effect of
showing up which accessor functions were missing. Added those.
* gtk/gtktreeviewcolumn.h: Replace set_justification with
set_alignment, to be consistent with GtkLabel, GtkMisc
* gtk/gtktreeviewcolumn.c: Added code to display sort indicator
arrow.
* gtk/Makefile.am (gtk_public_h_sources): add gtktreesortable.h
* gtk/gtktreesortable.h: updates in here
2001-02-08 23:36:53 +00:00
|
|
|
gtk_tree_view_column_get_sort_order (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
2001-01-09 23:24:20 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->sort_order;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
2001-01-19 22:39:19 +00:00
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_set_cell_data:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @tree_model: The #GtkTreeModel to to get the cell renderers attributes from.
|
|
|
|
* @iter: The #GtkTreeIter to to get the cell renderer's attributes from.
|
2001-12-08 21:39:34 +00:00
|
|
|
* @is_expander: %TRUE, if the row has children
|
|
|
|
* @is_expanded: %TRUE, if the row has visible children
|
2001-05-25 23:10:49 +00:00
|
|
|
*
|
2002-09-28 20:03:56 +00:00
|
|
|
* Sets the cell renderer based on the @tree_model and @iter. That is, for
|
2001-05-25 23:10:49 +00:00
|
|
|
* every attribute mapping in @tree_column, it will get a value from the set
|
2002-09-28 20:03:56 +00:00
|
|
|
* column on the @iter, and use that value to set the attribute on the cell
|
2001-12-08 21:39:34 +00:00
|
|
|
* renderer. This is used primarily by the #GtkTreeView.
|
2001-05-25 23:10:49 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_cell_set_cell_data (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkTreeModel *tree_model,
|
2001-08-19 04:19:56 +00:00
|
|
|
GtkTreeIter *iter,
|
|
|
|
gboolean is_expander,
|
|
|
|
gboolean is_expanded)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
if (tree_model == NULL)
|
|
|
|
return;
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_area_apply_attributes (tree_column->priv->cell_area, tree_model, iter,
|
2010-11-28 18:01:49 +00:00
|
|
|
is_expander, is_expanded);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2001-09-17 21:44:20 +00:00
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_get_size:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2010-02-19 16:53:17 +00:00
|
|
|
* @cell_area: (allow-none): The area a cell in the column will be allocated, or %NULL
|
2011-01-18 09:10:30 +00:00
|
|
|
* @x_offset: (out) (allow-none): location to return x offset of a cell relative to @cell_area, or %NULL
|
|
|
|
* @y_offset: (out) (allow-none): location to return y offset of a cell relative to @cell_area, or %NULL
|
|
|
|
* @width: (out) (allow-none): location to return width needed to render a cell, or %NULL
|
|
|
|
* @height: (out) (allow-none): location to return height needed to render a cell, or %NULL
|
2001-05-25 23:10:49 +00:00
|
|
|
*
|
|
|
|
* Obtains the width and height needed to render the column. This is used
|
2001-12-08 21:39:34 +00:00
|
|
|
* primarily by the #GtkTreeView.
|
2001-05-25 23:10:49 +00:00
|
|
|
**/
|
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
|
|
|
|
const GdkRectangle *cell_area,
|
|
|
|
gint *x_offset,
|
|
|
|
gint *y_offset,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
2001-09-08 00:56:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2010-12-04 07:24:31 +00:00
|
|
|
gint min_width = 0, min_height = 0;
|
2010-11-28 20:02:36 +00:00
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
2010-12-04 05:05:15 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_block (priv->cell_area_context,
|
|
|
|
priv->context_changed_signal);
|
|
|
|
|
|
|
|
gtk_cell_area_get_preferred_width (priv->cell_area,
|
|
|
|
priv->cell_area_context,
|
|
|
|
priv->tree_view,
|
2010-12-04 05:05:15 +00:00
|
|
|
NULL, NULL);
|
|
|
|
|
2010-12-04 07:24:31 +00:00
|
|
|
gtk_cell_area_context_get_preferred_width (priv->cell_area_context, &min_width, NULL);
|
2010-12-04 05:05:15 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_area_get_preferred_height_for_width (priv->cell_area,
|
|
|
|
priv->cell_area_context,
|
|
|
|
priv->tree_view,
|
2010-12-04 07:24:31 +00:00
|
|
|
min_width,
|
|
|
|
&min_height,
|
2010-11-28 18:01:49 +00:00
|
|
|
NULL);
|
2002-03-06 05:27:29 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_signal_handler_unblock (priv->cell_area_context,
|
|
|
|
priv->context_changed_signal);
|
2010-11-29 04:01:49 +00:00
|
|
|
|
2010-12-04 05:05:15 +00:00
|
|
|
|
|
|
|
if (height)
|
|
|
|
* height = min_height;
|
|
|
|
if (width)
|
|
|
|
* width = min_width;
|
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_render:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2010-08-24 13:45:41 +00:00
|
|
|
* @cr: cairo context to draw to
|
2001-09-25 16:44:39 +00:00
|
|
|
* @background_area: entire cell area (including tree expanders and maybe padding on the sides)
|
|
|
|
* @cell_area: area normally rendered by a cell renderer
|
|
|
|
* @flags: flags that affect rendering
|
|
|
|
*
|
|
|
|
* Renders the cell contained by #tree_column. This is used primarily by the
|
2001-12-08 21:39:34 +00:00
|
|
|
* #GtkTreeView.
|
2001-09-25 16:44:39 +00:00
|
|
|
**/
|
|
|
|
void
|
2008-01-25 09:30:40 +00:00
|
|
|
_gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column,
|
2010-08-24 13:45:41 +00:00
|
|
|
cairo_t *cr,
|
2008-01-25 09:30:40 +00:00
|
|
|
const GdkRectangle *background_area,
|
|
|
|
const GdkRectangle *cell_area,
|
2010-11-28 18:01:49 +00:00
|
|
|
guint flags,
|
|
|
|
gboolean draw_focus)
|
2001-09-25 16:44:39 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2010-08-24 13:45:41 +00:00
|
|
|
g_return_if_fail (cr != NULL);
|
2001-09-25 16:44:39 +00:00
|
|
|
g_return_if_fail (background_area != NULL);
|
|
|
|
g_return_if_fail (cell_area != NULL);
|
2010-08-24 13:45:41 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2010-08-24 13:45:41 +00:00
|
|
|
cairo_save (cr);
|
2001-09-25 16:44:39 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_area_render (priv->cell_area, priv->cell_area_context,
|
|
|
|
priv->tree_view, cr,
|
2010-11-28 18:01:49 +00:00
|
|
|
background_area, cell_area, flags,
|
|
|
|
draw_focus);
|
2010-08-24 13:45:41 +00:00
|
|
|
|
|
|
|
cairo_restore (cr);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
2001-09-18 16:15:10 +00:00
|
|
|
_gtk_tree_view_column_cell_event (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkEvent *event,
|
2008-01-25 09:30:40 +00:00
|
|
|
const GdkRectangle *cell_area,
|
2001-09-18 16:15:10 +00:00
|
|
|
guint flags)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
|
|
|
|
2001-05-25 23:10:49 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
return gtk_cell_area_event (priv->cell_area,
|
|
|
|
priv->cell_area_context,
|
|
|
|
priv->tree_view,
|
2010-11-28 18:01:49 +00:00
|
|
|
event,
|
|
|
|
cell_area,
|
|
|
|
flags);
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
|
2002-02-23 07:05:55 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_is_visible:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Returns %TRUE if any of the cells packed into the @tree_column are visible.
|
2002-02-23 07:05:55 +00:00
|
|
|
* For this to be meaningful, you must first initialize the cells with
|
|
|
|
* gtk_tree_view_column_cell_set_cell_data()
|
|
|
|
*
|
2003-04-12 22:25:21 +00:00
|
|
|
* Return value: %TRUE, if any of the cells packed into the @tree_column are currently visible
|
2002-02-23 07:05:55 +00:00
|
|
|
**/
|
2001-06-27 23:44:53 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GList *list;
|
2010-11-28 18:01:49 +00:00
|
|
|
GList *cells;
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2001-06-27 23:44:53 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
priv = tree_column->priv;
|
|
|
|
|
|
|
|
cells = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (priv->cell_area));
|
2010-11-28 18:01:49 +00:00
|
|
|
for (list = cells; list; list = list->next)
|
2001-06-27 23:44:53 +00:00
|
|
|
{
|
2010-11-28 18:01:49 +00:00
|
|
|
if (gtk_cell_renderer_get_visible (list->data))
|
|
|
|
{
|
|
|
|
g_list_free (cells);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
g_list_free (cells);
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_focus_cell:
|
2002-10-10 23:42:57 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
* @cell: A #GtkCellRenderer
|
|
|
|
*
|
|
|
|
* Sets the current keyboard focus to be at @cell, if the column contains
|
|
|
|
* 2 or more editable and activatable cells.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_focus_cell (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_area_set_focus_cell (tree_column->priv->cell_area, cell);
|
The "big treeview focus patch". Fixes several issues and adds some
Sun May 5 16:42:32 2002 Kristian Rietveld <kris@gtk.org>
The "big treeview focus patch". Fixes several issues and adds some
goodies. Related bugs: #73676, #73734, #78660.
* gtk/gtktreeview.h: add gtk_tree_view_set_cursor_on_cell
* gtk/gtktreeview.c (gtk_tree_view_button_press): focus on a cell
if applicable,
(gtk_tree_view_bin_expose): set_cell_data before iterating columns,
add support for row-spanning focus rectangles,
(gtk_tree_view_has_special_cell): new function,
(gtk_tree_view_move_cursor_left_right): add support for multiple
focusable cells in one column,
(gtk_tree_view_set_cursor): call _set_cursor_on_cell now,
(gtk_tree_view_set_cursor_on_cell): copy of _set_cursor, extended
with focus_cell parameter,
(gtk_tree_view_search_iter): removed unused column variable,
(gtk_tree_view_start_editing): add neighbor size code to allow
for multiple editable cells in one column.
* gtk/gtktreeviewcolumn.c (_GtkTreeViewColumnCellInfo): add
in_editing_mode field,
(gtk_tree_view_column_get_edited_cell): new function, removed
_get_editable_cell,
(_gtk_tree_view_column_get_cell_at_pos): new function,
(gtk_tree_view_column_pack_end): s/g_new/g_new0/ ...,
(gtk_tree_view_column_cell_process_action): loads of changes to get
it right and to allow for multiple special cells, etc,
(gtk_tree_view_column_cell_first): new function,
(gtk_tree_view_column_cell_last): ditto,
(gtk_tree_view_column_cell_next): ditto,
(gtk_tree_view_column_cell_prev): ditto,
(gtk_tree_view_column_cell_focus): add left and right parameters,
allow for multiple special cells,
(gtk_tree_view_column_cell_is_visible): add assertion,
(gtk_tree_view_column_focus_cell): new function,
(gtk_tree_view_column_stop_editing): unset in_editing_mode flag,
(_gtk_tree_view_column_get_neighbor_sizes): iterate through cells
correctly
* gtk/gtktreeviewcolumn.h: add gtk_tree_view_column_focus_cell
* gtk/gtktreeprivate.h: s/_get_editable_cell/_get_edited_cell/, add
_gtk_tree_view_column_get_cell_at_pos, add new parameters to
_gtk_tree_view_column_cell_focus.
* tests/testtreeedit.c: add some cells in order to test new code.
2002-05-05 14:54:00 +00:00
|
|
|
}
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
void
|
2002-02-19 18:21:50 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean install_handler)
|
2001-09-08 00:56:30 +00:00
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv = tree_column->priv;
|
|
|
|
|
|
|
|
priv->dirty = TRUE;
|
2010-12-06 07:31:07 +00:00
|
|
|
priv->padding = 0;
|
2010-11-30 05:29:45 +00:00
|
|
|
priv->width = 0;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2010-12-06 08:03:53 +00:00
|
|
|
/* Issue a manual reset on the context to have all
|
|
|
|
* sizes re-requested for the context.
|
|
|
|
*/
|
2010-12-12 07:43:07 +00:00
|
|
|
g_signal_handler_block (priv->cell_area_context,
|
|
|
|
priv->context_changed_signal);
|
|
|
|
gtk_cell_area_context_reset (priv->cell_area_context);
|
|
|
|
g_signal_handler_unblock (priv->cell_area_context,
|
|
|
|
priv->context_changed_signal);
|
2010-12-06 08:03:53 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (priv->tree_view &&
|
|
|
|
gtk_widget_get_realized (priv->tree_view))
|
2001-12-04 23:49:57 +00:00
|
|
|
{
|
2010-11-30 07:36:07 +00:00
|
|
|
_gtk_tree_view_install_mark_rows_col_dirty (GTK_TREE_VIEW (priv->tree_view), install_handler);
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_widget_queue_resize (priv->tree_view);
|
2001-12-04 23:49:57 +00:00
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gboolean
|
|
|
|
_gtk_tree_view_column_cell_get_dirty (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
return tree_column->priv->dirty;
|
|
|
|
}
|
|
|
|
|
2003-04-12 22:25:21 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_get_position:
|
|
|
|
* @tree_column: a #GtkTreeViewColumn
|
2003-04-15 22:51:04 +00:00
|
|
|
* @cell_renderer: a #GtkCellRenderer
|
2011-01-18 09:10:30 +00:00
|
|
|
* @x_offset: (out) (allow-none): return location for the horizontal
|
|
|
|
* position of @cell within @tree_column, may be %NULL
|
|
|
|
* @width: (out) (allow-none): return location for the width of @cell,
|
|
|
|
* may be %NULL
|
2003-04-12 22:25:21 +00:00
|
|
|
*
|
|
|
|
* Obtains the horizontal position and size of a cell in a column. If the
|
|
|
|
* cell is not found in the column, @start_pos and @width are not changed and
|
|
|
|
* %FALSE is returned.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @cell belongs to @tree_column.
|
|
|
|
*/
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_cell_get_position (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer,
|
2010-12-05 16:04:52 +00:00
|
|
|
gint *x_offset,
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
gint *width)
|
|
|
|
{
|
2010-11-30 05:29:45 +00:00
|
|
|
GtkTreeViewColumnPrivate *priv;
|
2011-01-07 14:10:06 +00:00
|
|
|
GdkRectangle cell_area;
|
2010-11-28 18:01:49 +00:00
|
|
|
GdkRectangle allocation;
|
2003-01-30 22:42:21 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell_renderer), FALSE);
|
|
|
|
|
|
|
|
priv = tree_column->priv;
|
|
|
|
|
2011-09-25 12:50:31 +00:00
|
|
|
if (! gtk_cell_area_has_renderer (priv->cell_area, cell_renderer))
|
|
|
|
return FALSE;
|
|
|
|
|
2011-01-07 14:10:06 +00:00
|
|
|
gtk_tree_view_get_background_area (GTK_TREE_VIEW (priv->tree_view),
|
|
|
|
NULL, tree_column, &cell_area);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
gtk_cell_area_get_cell_allocation (priv->cell_area,
|
|
|
|
priv->cell_area_context,
|
|
|
|
priv->tree_view,
|
2010-11-28 18:01:49 +00:00
|
|
|
cell_renderer,
|
2011-01-07 14:10:06 +00:00
|
|
|
&cell_area,
|
2010-11-28 18:01:49 +00:00
|
|
|
&allocation);
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
2010-12-05 16:04:52 +00:00
|
|
|
if (x_offset)
|
2011-09-25 15:43:45 +00:00
|
|
|
*x_offset = allocation.x - cell_area.x;
|
2011-01-07 14:10:06 +00:00
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
if (width)
|
|
|
|
*width = allocation.width;
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
|
2010-11-28 18:01:49 +00:00
|
|
|
return TRUE;
|
add a gtk_list_store_sort_iter_changed line for some special case ...
Tue Nov 26 22:26:04 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtk{tree,list}store.c (gtk_{tree,list}_store_real_set_value):
add a gtk_list_store_sort_iter_changed line for some special
case ... (#96647 (issue 1), testcases from Soeren Sandmann and
Daniel Elstner).
Tue Nov 26 22:18:06 2002 Kristian Rietveld <kris@gtk.org>
Inconsistent state for toggle renderers, requested by Paolo Bacchilega
in #88130.
* gtk/gtktreeprivate.h: move GtkCellRendererInfo here.
* gtk/gtkcellrenderer.c: moved GtkCellRendererInfo away,
fix some indentation issues.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_render): add an inconsistent property.
* gtk/gtkstyle.c (gtk_default_draw_check),
(gtk_default_draw_option): support drawing inconsistent
options/checks for cells.
Tue Nov 26 22:14:14 2002 Kristian Rietveld <kris@gtk.org>
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): add a focus_out_id to avoid
calling _editing_done twice (which has nasty side-effects). (#96647,
(issue 2) testcase from Soeren Sandmann).
Tue Nov 26 22:12:21 2002 Kristian Rietveld <kris@gtk.org>
#82739, patch from Padraig O'Briain.
* gtk/gtktreeviewcolumn.[ch]: add
gtk_tree_view_column_cell_get_position()
Tue Nov 26 22:06:29 2002 Kristian Rietveld <kris@gtk.org>
Yes, this chunk breaks ABI compatibility. Owen knows about it and
agreed with it. It doesn't break ABI that bad though, things will
still work. Please keep it silent :P.
This patch fixes some keynav issues reported by Narayana Pattipati
in #81633. (Also mentioned in #92037 (Sun tracking bug)).
* gtk/gtkmarshalers.list: add two silly marshalers
* gtk/gtktreeview.[ch] (gtk_tree_view_real_select_all),
(gtk_tree_view_real_unselect_all),
(gtk_tree_view_real_select_cursor_row),
(gtk_tree_view_real_toggle_cursor_row),
(gtk_tree_view_real_expand_collapse_cursor_row),
(gtk_tree_view_real_start_interactive_search): change the return
type from void to gboolean, update prototypes, functions, signals and
entries in GtkTreeViewClass,
(gtk_tree_view_class_init): add select_cursor_row binding for
enter key,
(gtk_tree_view_key_press): only navigate the header button if the
header is also visible ...
Tue Nov 26 22:05:48 2002 Kristian Rietveld <kris@gtk.org>
API bit of #75745, reported by Richard Hult.
* gtk/gtkcellrenderer.h (GtkCellRendererState): add
GTK_CELL_RENDERER_FOCUSED, rest of this bug fix will follow later.
2002-11-26 21:28:01 +00:00
|
|
|
}
|
2003-04-12 22:25:21 +00:00
|
|
|
|
2005-07-14 00:05:49 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_queue_resize:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Flags the column, and the cell renderers added to this column, to have
|
|
|
|
* their sizes renegotiated.
|
|
|
|
*
|
|
|
|
* Since: 2.8
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_queue_resize (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
2007-06-06 12:56:13 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2005-07-14 00:05:49 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
if (tree_column->priv->tree_view)
|
2005-07-14 00:05:49 +00:00
|
|
|
_gtk_tree_view_column_cell_set_dirty (tree_column, TRUE);
|
|
|
|
}
|
|
|
|
|
2007-06-06 12:54:35 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_tree_view:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
2010-09-21 04:18:11 +00:00
|
|
|
* Returns the #GtkTreeView wherein @tree_column has been inserted.
|
|
|
|
* If @column is currently not inserted in any tree view, %NULL is
|
2007-06-06 12:54:35 +00:00
|
|
|
* returned.
|
|
|
|
*
|
2010-09-21 04:18:11 +00:00
|
|
|
* Return value: (transfer none): The tree view wherein @column has
|
|
|
|
* been inserted if any, %NULL otherwise.
|
2007-06-06 12:54:35 +00:00
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
GtkWidget *
|
|
|
|
gtk_tree_view_column_get_tree_view (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
return tree_column->priv->tree_view;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_button:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn
|
|
|
|
*
|
|
|
|
* Returns the button used in the treeview column header
|
|
|
|
*
|
|
|
|
* Return value: (transfer none): The button for the column header.
|
|
|
|
*
|
|
|
|
* Since: 3.0
|
|
|
|
*/
|
|
|
|
GtkWidget *
|
|
|
|
gtk_tree_view_column_get_button (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), NULL);
|
|
|
|
|
|
|
|
return tree_column->priv->button;
|
|
|
|
}
|
|
|
|
|
|
|
|
GdkWindow *
|
|
|
|
_gtk_tree_view_column_get_window (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
return column->priv->window;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2010-12-06 07:31:07 +00:00
|
|
|
_gtk_tree_view_column_push_padding (GtkTreeViewColumn *column,
|
|
|
|
gint padding)
|
2010-11-30 05:29:45 +00:00
|
|
|
{
|
2010-12-06 07:31:07 +00:00
|
|
|
column->priv->padding = MAX (column->priv->padding, padding);
|
2010-11-30 05:29:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
_gtk_tree_view_column_get_requested_width (GtkTreeViewColumn *column)
|
|
|
|
{
|
2010-12-06 07:31:07 +00:00
|
|
|
gint requested_width;
|
|
|
|
|
|
|
|
gtk_cell_area_context_get_preferred_width (column->priv->cell_area_context, &requested_width, NULL);
|
|
|
|
|
|
|
|
return requested_width + column->priv->padding;
|
2010-11-30 05:29:45 +00:00
|
|
|
}
|
|
|
|
|
2010-12-06 07:31:07 +00:00
|
|
|
|
2010-11-30 05:29:45 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_set_resized_width (GtkTreeViewColumn *column,
|
|
|
|
gint width)
|
|
|
|
{
|
|
|
|
column->priv->resized_width = width;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
_gtk_tree_view_column_get_resized_width (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
return column->priv->resized_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_set_use_resized_width (GtkTreeViewColumn *column,
|
|
|
|
gboolean use_resized_width)
|
|
|
|
{
|
|
|
|
column->priv->use_resized_width = use_resized_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
_gtk_tree_view_column_get_use_resized_width (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
return column->priv->use_resized_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
gint
|
|
|
|
_gtk_tree_view_column_get_drag_x (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
return column->priv->drag_x;
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkCellAreaContext *
|
|
|
|
_gtk_tree_view_column_get_context (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
return column->priv->cell_area_context;
|
2007-06-06 12:54:35 +00:00
|
|
|
}
|