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
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "gtktreeviewcolumn.h"
|
2001-03-02 00:49:32 +00:00
|
|
|
#include "gtktreeview.h"
|
2000-10-05 01:04:57 +00:00
|
|
|
#include "gtktreeprivate.h"
|
|
|
|
#include "gtksignal.h"
|
|
|
|
#include "gtkbutton.h"
|
|
|
|
#include "gtkalignment.h"
|
2000-10-16 17:50:15 +00:00
|
|
|
#include "gtklabel.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 "gtkhbox.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"
|
2001-01-09 23:24:20 +00:00
|
|
|
#include "gtkintl.h"
|
2001-03-29 21:30:05 +00:00
|
|
|
#include <string.h>
|
2001-04-12 16:11:54 +00:00
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_VISIBLE,
|
2001-11-19 21:18:22 +00:00
|
|
|
PROP_RESIZABLE,
|
2001-01-09 23:24:20 +00:00
|
|
|
PROP_WIDTH,
|
2001-09-08 00:56:30 +00:00
|
|
|
PROP_SIZING,
|
|
|
|
PROP_FIXED_WIDTH,
|
2001-01-09 23:24:20 +00:00
|
|
|
PROP_MIN_WIDTH,
|
|
|
|
PROP_MAX_WIDTH,
|
|
|
|
PROP_TITLE,
|
|
|
|
PROP_CLICKABLE,
|
|
|
|
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
|
|
|
PROP_ALIGNMENT,
|
2001-05-16 00:23:30 +00:00
|
|
|
PROP_REORDERABLE,
|
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_SORT_INDICATOR,
|
|
|
|
PROP_SORT_ORDER
|
2001-01-09 23:24:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2000-10-05 01:04:57 +00:00
|
|
|
CLICKED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
typedef struct _GtkTreeViewColumnCellInfo GtkTreeViewColumnCellInfo;
|
|
|
|
struct _GtkTreeViewColumnCellInfo
|
|
|
|
{
|
|
|
|
GtkCellRenderer *cell;
|
|
|
|
GSList *attributes;
|
|
|
|
GtkTreeCellDataFunc func;
|
|
|
|
gpointer func_data;
|
|
|
|
GtkDestroyNotify destroy;
|
2001-06-30 02:38:17 +00:00
|
|
|
gint requested_width;
|
2001-06-27 23:44:53 +00:00
|
|
|
guint expand : 1;
|
|
|
|
guint pack : 1;
|
2001-09-08 00:56:30 +00:00
|
|
|
guint has_focus : 1;
|
2001-06-27 23:44:53 +00:00
|
|
|
};
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Type methods */
|
|
|
|
static void gtk_tree_view_column_init (GtkTreeViewColumn *tree_column);
|
|
|
|
static void gtk_tree_view_column_class_init (GtkTreeViewColumnClass *klass);
|
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
|
|
|
/* Button handling code */
|
|
|
|
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_realize (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
static void gtk_tree_view_column_button_clicked (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
/* Property handlers */
|
|
|
|
static void gtk_tree_view_model_sort_column_changed (GtkTreeSortable *sortable,
|
|
|
|
GtkTreeViewColumn *tree_column);
|
|
|
|
|
|
|
|
/* 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);
|
2001-06-27 23:44:53 +00:00
|
|
|
static GtkTreeViewColumnCellInfo *gtk_tree_view_column_get_cell_info (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
static GtkObjectClass *parent_class = NULL;
|
|
|
|
static guint tree_column_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
GtkType
|
|
|
|
gtk_tree_view_column_get_type (void)
|
|
|
|
{
|
|
|
|
static GtkType tree_column_type = 0;
|
|
|
|
|
|
|
|
if (!tree_column_type)
|
|
|
|
{
|
|
|
|
static const GTypeInfo tree_column_info =
|
|
|
|
{
|
|
|
|
sizeof (GtkTreeViewColumnClass),
|
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gtk_tree_view_column_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GtkTreeViewColumn),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gtk_tree_view_column_init,
|
|
|
|
};
|
|
|
|
|
urg, removed implementation of gtk_marshal_VOID__INT_INT_INT_INT. if
Wed Oct 25 20:47:41 2000 Tim Janik <timj@gtk.org>
* gtk/gdk-pixbuf-loader.c (gdk_pixbuf_loader_class_init): urg, removed
implementation of gtk_marshal_VOID__INT_INT_INT_INT. if people do that,
couldn't they at least give it a non-standard name?
* gtk/gtktextlayout.c: arg! yet another implementation of
gtk_marshal_VOID__INT_INT_INT_INT(), is this a conspiracy?
* gtk/gtktextbuffer.c: gotcha! captured a vagabonding
gtk_marshal_VOID__INT_POINTER_INT() implementation, braught it back
home. now i know this _is_ a conspiracy.
* gtk/gtkwidget.c (gtk_widget_class_init): marshaller fixups for
::state-changed.
* gtk/gtkaccelgroup.c (gtk_accel_group_create_remove):
(gtk_accel_group_create_add): marshaller signature fixups.
* gtk/gtklistitem.c (gtk_list_item_class_init): signal creation fixups,
pass in GTK_TYPE_SCROLL_TYPE instead of GTK_TYPE_ENUM.
* gtk/gtkobject.[hc]: removed GTK_CONNECTED flag, it's not valid
anymore.
Tue Oct 24 23:59:21 2000 Tim Janik <timj@gtk.org>
* docs/reference/Makefile.am: disabled SUBDIRS for the moment, since
due to the signal system changes, it wouldn't build currently. to
be fixed soon.
* docs/Changes-2.0.txt: GtkSignal/GSignal updates.
* gtk/gtkwidget.c: ::direction_changed takes an enum as argument,
so it needs gtk_marshal_VOID__ENUM() instead of
gtk_marshal_NONE__UINT().
* gdk/gdk*.c: adapted type registration functions.
* gtk/gtkbindings.c:
* gtk/gtkaccelgroup.c: operate on GSignalQuery, GtkSignalQuery is
gone.
* gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType.
* gtk/gtkobject.c:
(gtk_object_destroy):
(gtk_object_shutdown): fixed recursion guards. basically we have to
catch the case where any of GObject.shutdown() or gtk_object_destroy()
is called during ::destroy, and avoid recursion there.
* gtk/gtktypeutils.c:
* gtk/maketypes.awk: awk-script hackup to provide gtk_type_init() with
boxed_copy/boxed_free. this needs a more general solution based on a
publically installed code-generator utility.
* gtk/gtktypeutils.[hc]: compat aliased GTK_TYPE_BOXED to G_TYPE_BOXED,
glib's gobject has support for that now.
define GtkSignalMarshaller in terms of GSignalCMarshaller.
Mon Oct 23 09:36:42 2000 Tim Janik <timj@gtk.org>
* gtk/gtksignal.[hc]:
* gtk/gtkmarshal.[hc]:
* gtk/Makefile.am: generate marshallers with glib-genmarshal and don't
compile gtkmarshal.c on its own anymore, just include it in gtksignal.c.
removed #include <gtkmarshal.h>s all over the place, gtksignal.h takes
care of that.
* *.c: marshaller name fixups.
* gtk/gtkmarshal.list: added a comment briefing the format.
Sun Oct 22 23:14:39 2000 Tim Janik <timj@gtk.org>
* gtk/gtksignal.[hc]: nuked old implementation. we mostly have
compatibility macros here now. more specifically, most of
the API is preserved (yes, _most_, nonwithstanding the
following exceptions listed, the API is stil lHUGE ;)
things that got removed completely:
GtkSignalQuery, gtk_signal_query(), gtk_signal_n_emissions(),
gtk_signal_n_emissions_by_name(), gtk_signal_handlers_destroy(),
gtk_signal_set_funcs(), gtk_signal_handler_pending_by_id(),
gtk_signal_add_emission_hook(), gtk_signal_add_emission_hook_full(),
gtk_signal_remove_emission_hook().
non-functional functions variants:
gtk_signal_add_emission_hook(), gtk_signal_remove_emission_hook().
the GtkCallbackMarshal argument to gtk_signal_connect_full() is
not supported anymore.
(gtk_signal_compat_matched): new internal function to aid
implementation of the compatibility macros, it provides
functionality to block/unblock/disconnect handlers based
on func/data.
* gtk/gtkenums.h: define GtkSignalRunType in terms of GSignalType,
* *.c: adaptions to new type registration API signatures.
Fri Oct 20 15:26:33 2000 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.[hc]: removed G_TYPE_GTK_POINTER cludge.
2000-10-25 22:34:14 +00:00
|
|
|
tree_column_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkTreeViewColumn", &tree_column_info, 0);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return tree_column_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
parent_class = g_type_class_peek_parent (class);
|
|
|
|
|
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
|
|
|
|
2001-02-17 00:16:08 +00:00
|
|
|
object_class->finalize = gtk_tree_view_column_finalize;
|
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] =
|
2001-06-29 16:30:25 +00:00
|
|
|
g_signal_new ("clicked",
|
|
|
|
GTK_CLASS_TYPE (object_class),
|
|
|
|
G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GtkTreeViewColumnClass, clicked),
|
|
|
|
NULL, NULL,
|
2001-11-17 23:28:51 +00:00
|
|
|
_gtk_marshal_VOID__VOID,
|
2001-06-29 16:30:25 +00:00
|
|
|
GTK_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",
|
|
|
|
_("Visible"),
|
2001-06-27 23:34:43 +00:00
|
|
|
_("Whether to display the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
TRUE,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_RESIZABLE,
|
|
|
|
g_param_spec_boolean ("resizable",
|
|
|
|
_("Resizable"),
|
|
|
|
_("Column is user-resizable"),
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDTH,
|
|
|
|
g_param_spec_int ("width",
|
|
|
|
_("Width"),
|
|
|
|
_("Current width of the column"),
|
|
|
|
0,
|
|
|
|
G_MAXINT,
|
|
|
|
0,
|
|
|
|
G_PARAM_READABLE));
|
2001-01-09 23:24:20 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SIZING,
|
|
|
|
g_param_spec_enum ("sizing",
|
|
|
|
_("Sizing"),
|
|
|
|
_("Resize mode of the column"),
|
|
|
|
GTK_TYPE_TREE_VIEW_COLUMN_SIZING,
|
|
|
|
GTK_TREE_VIEW_COLUMN_AUTOSIZE,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
2001-09-08 00:56:30 +00:00
|
|
|
PROP_FIXED_WIDTH,
|
|
|
|
g_param_spec_int ("fixed_width",
|
|
|
|
_("Fixed Width"),
|
|
|
|
_("Current fixed width of the column"),
|
2001-01-09 23:24:20 +00:00
|
|
|
1,
|
|
|
|
G_MAXINT,
|
|
|
|
1, /* not useful */
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_MIN_WIDTH,
|
|
|
|
g_param_spec_int ("min_width",
|
|
|
|
_("Minimum Width"),
|
|
|
|
_("Minimum allowed width of the column"),
|
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
2001-09-08 00:56:30 +00:00
|
|
|
-1,
|
2001-01-09 23:24:20 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_MAX_WIDTH,
|
|
|
|
g_param_spec_int ("max_width",
|
|
|
|
_("Maximum Width"),
|
|
|
|
_("Maximum allowed width of the column"),
|
|
|
|
-1,
|
|
|
|
G_MAXINT,
|
2001-09-08 00:56:30 +00:00
|
|
|
-1,
|
2001-01-09 23:24:20 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_TITLE,
|
|
|
|
g_param_spec_string ("title",
|
|
|
|
_("Title"),
|
|
|
|
_("Title to appear in column header"),
|
|
|
|
"",
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_CLICKABLE,
|
|
|
|
g_param_spec_boolean ("clickable",
|
|
|
|
_("Clickable"),
|
|
|
|
_("Whether the header can be clicked"),
|
|
|
|
TRUE,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_WIDGET,
|
|
|
|
g_param_spec_object ("widget",
|
|
|
|
_("Widget"),
|
|
|
|
_("Widget to put in column header button instead of column title"),
|
|
|
|
GTK_TYPE_WIDGET,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
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",
|
|
|
|
_("Alignment"),
|
2001-06-05 15:30:53 +00:00
|
|
|
_("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,
|
|
|
|
0.5,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_REORDERABLE,
|
|
|
|
g_param_spec_boolean ("reorderable",
|
|
|
|
_("Reorderable"),
|
2001-09-29 19:29:46 +00:00
|
|
|
_("Whether the column can be reordered around the headers"),
|
2001-05-16 00:23:30 +00:00
|
|
|
FALSE,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
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,
|
|
|
|
g_param_spec_boolean ("sort_indicator",
|
|
|
|
_("Sort indicator"),
|
|
|
|
_("Whether to show a sort indicator"),
|
|
|
|
FALSE,
|
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
|
|
|
|
|
|
|
g_object_class_install_property (object_class,
|
|
|
|
PROP_SORT_ORDER,
|
|
|
|
g_param_spec_enum ("sort_order",
|
|
|
|
_("Sort order"),
|
|
|
|
_("Sort direction the sort indicator should indicate"),
|
2001-08-23 18:33:37 +00:00
|
|
|
GTK_TYPE_SORT_TYPE,
|
|
|
|
GTK_SORT_ASCENDING,
|
2001-01-09 23:24:20 +00:00
|
|
|
G_PARAM_READABLE | G_PARAM_WRITABLE));
|
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-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_init (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
tree_column->button = NULL;
|
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->xalign = 0.0;
|
2001-09-08 00:56:30 +00:00
|
|
|
tree_column->width = 0;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->requested_width = -1;
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->min_width = -1;
|
|
|
|
tree_column->max_width = -1;
|
2001-09-08 00:56:30 +00:00
|
|
|
tree_column->column_type = GTK_TREE_VIEW_COLUMN_GROW_ONLY;
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->visible = TRUE;
|
2001-11-19 21:18:22 +00:00
|
|
|
tree_column->resizable = FALSE;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->clickable = FALSE;
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->dirty = TRUE;
|
2001-08-23 18:33:37 +00:00
|
|
|
tree_column->sort_order = GTK_SORT_ASCENDING;
|
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->show_sort_indicator = FALSE;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->property_changed_signal = 0;
|
2001-03-29 21:30:05 +00:00
|
|
|
tree_column->sort_clicked_signal = 0;
|
|
|
|
tree_column->sort_column_changed_signal = 0;
|
2001-03-28 01:54:14 +00:00
|
|
|
tree_column->sort_column_id = -1;
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->reorderable = FALSE;
|
|
|
|
tree_column->maybe_reordered = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumn *tree_column = (GtkTreeViewColumn *) object;
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
if (info->func_data && info->destroy)
|
|
|
|
(info->destroy) (info->func_data);
|
|
|
|
gtk_tree_view_column_clear_attributes (tree_column, info->cell);
|
|
|
|
g_object_unref (G_OBJECT (info->cell));
|
|
|
|
g_free (info);
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
g_free (tree_column->title);
|
2001-08-23 16:54:49 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
case PROP_TITLE:
|
|
|
|
gtk_tree_view_column_set_title (tree_column,
|
|
|
|
g_value_get_string (value));
|
|
|
|
break;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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-09-08 00:56:30 +00:00
|
|
|
case PROP_WIDTH:
|
|
|
|
g_value_set_int (value,
|
|
|
|
gtk_tree_view_column_get_width (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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2001-01-09 23:24:20 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/* Helper functions
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* 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
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
GtkTreeView *tree_view;
|
|
|
|
GtkWidget *child;
|
|
|
|
GtkWidget *hbox;
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_view = (GtkTreeView *) tree_column->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));
|
|
|
|
g_return_if_fail (tree_column->button == NULL);
|
|
|
|
|
|
|
|
gtk_widget_push_composite_child ();
|
|
|
|
tree_column->button = gtk_button_new ();
|
|
|
|
gtk_widget_pop_composite_child ();
|
|
|
|
|
|
|
|
/* make sure we own a reference to it as well. */
|
2001-05-25 23:10:49 +00:00
|
|
|
if (tree_view->priv->header_window)
|
|
|
|
gtk_widget_set_parent_window (tree_column->button, tree_view->priv->header_window);
|
2001-07-19 14:57:15 +00:00
|
|
|
gtk_widget_set_parent (tree_column->button, GTK_WIDGET (tree_view));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (tree_column->button), "realize",
|
|
|
|
(GtkSignalFunc) gtk_tree_view_column_button_realize,
|
|
|
|
NULL);
|
2001-05-22 19:18:47 +00:00
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (tree_column->button), "event",
|
|
|
|
(GtkSignalFunc) gtk_tree_view_column_button_event,
|
|
|
|
(gpointer) tree_column);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (tree_column->button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_tree_view_column_button_clicked,
|
|
|
|
(gpointer) tree_column);
|
|
|
|
|
|
|
|
tree_column->alignment = gtk_alignment_new (tree_column->xalign, 0.5, 0.0, 0.0);
|
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
|
|
|
tree_column->arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_IN);
|
|
|
|
|
|
|
|
if (tree_column->child)
|
|
|
|
child = tree_column->child;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
child = gtk_label_new (tree_column->title);
|
|
|
|
gtk_widget_show (child);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tree_column->xalign <= 0.5)
|
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), tree_column->arrow, FALSE, FALSE, 0);
|
|
|
|
else
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), tree_column->arrow, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), tree_column->alignment, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_column->alignment), child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (tree_column->button), hbox);
|
|
|
|
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_widget_show (tree_column->alignment);
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *alignment;
|
|
|
|
GtkWidget *arrow;
|
|
|
|
GtkWidget *current_child;
|
|
|
|
|
|
|
|
/* Create a button if necessary */
|
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->button == NULL &&
|
|
|
|
tree_column->tree_view &&
|
|
|
|
GTK_WIDGET_REALIZED (tree_column->tree_view))
|
|
|
|
gtk_tree_view_column_create_button (tree_column);
|
|
|
|
|
|
|
|
if (! tree_column->button)
|
|
|
|
return;
|
|
|
|
|
|
|
|
hbox = GTK_BIN (tree_column->button)->child;
|
|
|
|
alignment = tree_column->alignment;
|
|
|
|
arrow = tree_column->arrow;
|
|
|
|
current_child = GTK_BIN (alignment)->child;
|
|
|
|
|
|
|
|
/* Set up the actual button */
|
|
|
|
gtk_alignment_set (GTK_ALIGNMENT (alignment), tree_column->xalign,
|
|
|
|
0.5, 0.0, 0.0);
|
|
|
|
|
|
|
|
if (tree_column->child)
|
|
|
|
{
|
|
|
|
if (current_child != tree_column->child)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (alignment),
|
|
|
|
current_child);
|
|
|
|
gtk_container_add (GTK_CONTAINER (alignment),
|
|
|
|
tree_column->child);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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));
|
|
|
|
|
|
|
|
if (tree_column->title)
|
|
|
|
gtk_label_set_text (GTK_LABEL (current_child),
|
|
|
|
tree_column->title);
|
|
|
|
else
|
|
|
|
gtk_label_set_text (GTK_LABEL (current_child),
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (tree_column->sort_order)
|
|
|
|
{
|
2001-08-23 18:33:37 +00:00
|
|
|
case GTK_SORT_ASCENDING:
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_arrow_set (GTK_ARROW (arrow),
|
|
|
|
GTK_ARROW_DOWN,
|
|
|
|
GTK_SHADOW_IN);
|
|
|
|
break;
|
|
|
|
|
2001-08-23 18:33:37 +00:00
|
|
|
case GTK_SORT_DESCENDING:
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_arrow_set (GTK_ARROW (arrow),
|
|
|
|
GTK_ARROW_UP,
|
|
|
|
GTK_SHADOW_IN);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
g_warning (G_STRLOC": bad sort order");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 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
|
|
|
|
*/
|
|
|
|
gtk_widget_ref (arrow);
|
|
|
|
gtk_container_remove (GTK_CONTAINER (hbox), arrow);
|
|
|
|
|
|
|
|
if (tree_column->xalign <= 0.5)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
gtk_widget_unref (arrow);
|
|
|
|
|
|
|
|
if (tree_column->show_sort_indicator)
|
|
|
|
gtk_widget_show (arrow);
|
|
|
|
else
|
|
|
|
gtk_widget_hide (arrow);
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
if (tree_column->button &&
|
|
|
|
tree_column->tree_view != NULL &&
|
|
|
|
GTK_WIDGET_REALIZED (tree_column->tree_view))
|
|
|
|
{
|
|
|
|
if (tree_column->visible)
|
|
|
|
{
|
2001-05-25 23:10:49 +00:00
|
|
|
gtk_widget_show_now (tree_column->button);
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->window)
|
|
|
|
{
|
2001-11-19 21:18:22 +00:00
|
|
|
if (tree_column->resizable)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
gdk_window_show (tree_column->window);
|
|
|
|
gdk_window_raise (tree_column->window);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gdk_window_hide (tree_column->window);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_widget_hide (tree_column->button);
|
|
|
|
if (tree_column->window)
|
|
|
|
gdk_window_hide (tree_column->window);
|
|
|
|
}
|
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
|
|
|
|
if (tree_column->reorderable || tree_column->clickable)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
|
|
|
GTK_WIDGET_SET_FLAGS (tree_column->button, GTK_CAN_FOCUS);
|
|
|
|
}
|
2001-05-22 19:18:47 +00:00
|
|
|
else
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
|
|
|
GTK_WIDGET_UNSET_FLAGS (tree_column->button, GTK_CAN_FOCUS);
|
|
|
|
if (GTK_WIDGET_HAS_FOCUS (tree_column->button))
|
2001-07-05 02:58:34 +00:00
|
|
|
{
|
|
|
|
GtkWidget *toplevel = gtk_widget_get_toplevel (tree_column->tree_view);
|
|
|
|
if (GTK_WIDGET_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
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_cell_set_dirty (tree_column);
|
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
|
|
|
{
|
2001-05-22 19:18:47 +00:00
|
|
|
GtkTreeViewColumn *column = (GtkTreeViewColumn *) data;
|
|
|
|
|
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 &&
|
|
|
|
column->reorderable)
|
|
|
|
{
|
|
|
|
column->maybe_reordered = TRUE;
|
|
|
|
gdk_window_get_pointer (widget->window,
|
|
|
|
&column->drag_x,
|
|
|
|
&column->drag_y,
|
|
|
|
NULL);
|
|
|
|
gtk_widget_grab_focus (widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (event->type == GDK_BUTTON_RELEASE &&
|
|
|
|
column->maybe_reordered)
|
|
|
|
column->maybe_reordered = FALSE;
|
|
|
|
|
|
|
|
if (event->type == GDK_MOTION_NOTIFY &&
|
|
|
|
(column->maybe_reordered) &&
|
|
|
|
(gtk_drag_check_threshold (widget,
|
|
|
|
column->drag_x,
|
|
|
|
column->drag_y,
|
|
|
|
(gint) ((GdkEventMotion *)event)->x,
|
|
|
|
(gint) ((GdkEventMotion *)event)->y)))
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2001-05-22 19:18:47 +00:00
|
|
|
column->maybe_reordered = FALSE;
|
|
|
|
_gtk_tree_view_column_start_drag (GTK_TREE_VIEW (column->tree_view), column);
|
2000-10-05 01:04:57 +00:00
|
|
|
return TRUE;
|
2001-05-22 19:18:47 +00:00
|
|
|
}
|
|
|
|
if (column->clickable == FALSE)
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_button_realize (GtkWidget *widget, gpointer data)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
gdk_window_set_events (widget->window, gdk_window_get_events (widget->window) | GDK_POINTER_MOTION_MASK);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
static void
|
|
|
|
gtk_tree_view_column_button_clicked (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
g_signal_emit_by_name (G_OBJECT (data), "clicked");
|
2001-04-12 16:11:54 +00:00
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
|
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,
|
|
|
|
GtkTreeViewColumn *column)
|
2001-04-12 16:11:54 +00:00
|
|
|
{
|
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))
|
|
|
|
{
|
|
|
|
if (sort_column_id == column->sort_column_id)
|
|
|
|
{
|
|
|
|
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
|
|
|
{
|
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
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
g_return_if_fail (tree_column->tree_view != NULL);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-10-06 00:50:36 +00:00
|
|
|
has_sort_column =
|
|
|
|
gtk_tree_sortable_get_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
&sort_column_id,
|
|
|
|
&order);
|
|
|
|
has_default_sort_func =
|
|
|
|
gtk_tree_sortable_has_default_sort_func (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model));
|
|
|
|
|
|
|
|
if (has_sort_column &&
|
|
|
|
sort_column_id == tree_column->sort_column_id)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
if (order == GTK_SORT_ASCENDING)
|
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
tree_column->sort_column_id,
|
|
|
|
GTK_SORT_DESCENDING);
|
|
|
|
else if (order == GTK_SORT_DESCENDING && has_default_sort_func)
|
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID,
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
else
|
2001-10-06 00:50:36 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
tree_column->sort_column_id,
|
|
|
|
GTK_SORT_ASCENDING);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-10-06 00:50:36 +00:00
|
|
|
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (GTK_TREE_VIEW (tree_column->tree_view)->priv->model),
|
|
|
|
tree_column->sort_column_id,
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
GtkTreeModel *model;
|
|
|
|
|
|
|
|
if (tree_column->tree_view == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
model = gtk_tree_view_get_model (GTK_TREE_VIEW (tree_column->tree_view));
|
|
|
|
|
|
|
|
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) &&
|
|
|
|
tree_column->sort_column_id != -1)
|
|
|
|
{
|
|
|
|
gint real_sort_column_id;
|
2001-08-23 18:33:37 +00:00
|
|
|
GtkSortType real_order;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
if (tree_column->sort_column_changed_signal == 0)
|
|
|
|
tree_column->sort_column_changed_signal =
|
2001-06-29 16:30:25 +00:00
|
|
|
g_signal_connect (G_OBJECT (model), "sort_column_changed",
|
|
|
|
GTK_SIGNAL_FUNC (gtk_tree_view_model_sort_column_changed),
|
|
|
|
tree_column);
|
|
|
|
|
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) &&
|
|
|
|
(real_sort_column_id == tree_column->sort_column_id))
|
|
|
|
{
|
|
|
|
gtk_tree_view_column_set_sort_indicator (tree_column, TRUE);
|
|
|
|
gtk_tree_view_column_set_sort_order (tree_column, real_order);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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)
|
|
|
|
{
|
|
|
|
GtkTreeView *tree_view;
|
|
|
|
GdkWindowAttr attr;
|
|
|
|
guint attributes_mask;
|
|
|
|
|
|
|
|
tree_view = (GtkTreeView *)column->tree_view;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
|
|
|
|
g_return_if_fail (GTK_WIDGET_REALIZED (tree_view));
|
|
|
|
g_return_if_fail (tree_view->priv->header_window != NULL);
|
|
|
|
g_return_if_fail (column->button != NULL);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_widget_set_parent_window (column->button, tree_view->priv->header_window);
|
|
|
|
|
|
|
|
if (column->visible)
|
|
|
|
gtk_widget_show (column->button);
|
|
|
|
|
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));
|
|
|
|
attr.colormap = gtk_widget_get_colormap (GTK_WIDGET (tree_view));
|
|
|
|
attr.event_mask = gtk_widget_get_events (GTK_WIDGET (tree_view));
|
|
|
|
attr.event_mask = (GDK_BUTTON_PRESS_MASK |
|
|
|
|
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;
|
|
|
|
attr.cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
|
|
|
|
|
|
|
|
attr.y = 0;
|
|
|
|
attr.width = TREE_VIEW_DRAG_WIDTH;
|
|
|
|
attr.height = tree_view->priv->header_height;
|
|
|
|
|
|
|
|
attr.x = (column->button->allocation.x + column->button->allocation.width) - 3;
|
|
|
|
|
|
|
|
column->window = gdk_window_new (tree_view->priv->header_window,
|
|
|
|
&attr, attributes_mask);
|
|
|
|
gdk_window_set_user_data (column->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
|
|
|
|
|
|
|
gdk_cursor_unref (attr.cursor);
|
2001-03-02 00:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_unrealize_button (GtkTreeViewColumn *column)
|
|
|
|
{
|
|
|
|
g_return_if_fail (column != NULL);
|
|
|
|
g_return_if_fail (column->window != NULL);
|
|
|
|
|
|
|
|
gdk_window_set_user_data (column->window, NULL);
|
|
|
|
gdk_window_destroy (column->window);
|
|
|
|
column->window = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_set_tree_view (GtkTreeViewColumn *column,
|
|
|
|
GtkTreeView *tree_view)
|
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
g_assert (column->tree_view == NULL);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
column->tree_view = GTK_WIDGET (tree_view);
|
|
|
|
gtk_tree_view_column_create_button (column);
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-06-01 22:57:30 +00:00
|
|
|
column->property_changed_signal =
|
2001-07-09 17:09:35 +00:00
|
|
|
g_signal_connect_swapped (GTK_OBJECT (tree_view),
|
|
|
|
"notify::model",
|
|
|
|
GTK_SIGNAL_FUNC (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)
|
|
|
|
{
|
|
|
|
if (column->tree_view && column->button)
|
|
|
|
{
|
|
|
|
gtk_container_remove (GTK_CONTAINER (column->tree_view), column->button);
|
|
|
|
}
|
2001-05-16 00:23:30 +00:00
|
|
|
if (column->property_changed_signal)
|
|
|
|
{
|
|
|
|
g_signal_handler_disconnect (G_OBJECT (column->tree_view), column->property_changed_signal);
|
|
|
|
column->property_changed_signal = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (column->sort_column_changed_signal)
|
|
|
|
{
|
2001-08-21 04:49:15 +00:00
|
|
|
g_signal_handler_disconnect (G_OBJECT (gtk_tree_view_get_model (GTK_TREE_VIEW (column->tree_view))),
|
|
|
|
column->sort_column_changed_signal);
|
2001-05-16 00:23:30 +00:00
|
|
|
column->sort_column_changed_signal = 0;
|
|
|
|
}
|
|
|
|
|
2001-03-02 00:49:32 +00:00
|
|
|
column->tree_view = NULL;
|
|
|
|
column->button = NULL;
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_set_width (GtkTreeViewColumn *tree_column,
|
|
|
|
gint width)
|
|
|
|
{
|
|
|
|
if (tree_column->min_width != -1 &&
|
|
|
|
width <= tree_column->min_width)
|
|
|
|
width = tree_column->min_width;
|
|
|
|
else if (tree_column->max_width != -1 &&
|
|
|
|
width > tree_column->max_width)
|
|
|
|
width = tree_column->max_width;
|
|
|
|
|
|
|
|
if (tree_column->width == width)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_column->width = width;
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "width");
|
|
|
|
|
|
|
|
if (tree_column->tree_view != NULL)
|
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
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
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column = GTK_TREE_VIEW_COLUMN (gtk_type_new (GTK_TYPE_TREE_VIEW_COLUMN));
|
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
|
|
|
}
|
|
|
|
|
2000-10-16 06:14:53 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_new_with_attributes:
|
|
|
|
* @title: The title to set the header to.
|
|
|
|
* @cell: The #GtkCellRenderer.
|
2000-10-30 23:21:38 +00:00
|
|
|
* @Varargs: A NULL terminated list of attributes.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
|
|
|
* Creates a new #GtkTreeViewColumn with a number of default values. This is
|
|
|
|
* equivalent to calling @gtk_tree_view_column_set_title,
|
2001-09-25 19:38:18 +00:00
|
|
|
* @gtk_tree_view_column_pack_start, and
|
2000-10-16 06:14:53 +00:00
|
|
|
* @gtk_tree_view_column_set_attributes on the newly created #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
static GtkTreeViewColumnCellInfo *
|
|
|
|
gtk_tree_view_column_get_cell_info (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellRenderer *cell_renderer)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
if (((GtkTreeViewColumnCellInfo *)list->data)->cell == cell_renderer)
|
|
|
|
return (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
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.
|
|
|
|
* @cell: The #GtkCellRenderer,
|
|
|
|
* @expand: TRUE if @cell is to be given extra space allocated to box.
|
|
|
|
*
|
|
|
|
**/
|
|
|
|
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
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *cell_info;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
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));
|
|
|
|
g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell));
|
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-06-27 23:44:53 +00:00
|
|
|
g_object_ref (G_OBJECT (cell));
|
2001-08-19 06:58:11 +00:00
|
|
|
gtk_object_sink (GTK_OBJECT (cell));
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
cell_info = g_new0 (GtkTreeViewColumnCellInfo, 1);
|
|
|
|
cell_info->cell = cell;
|
|
|
|
cell_info->expand = expand ? TRUE : FALSE;
|
|
|
|
cell_info->pack = GTK_PACK_START;
|
2001-09-08 00:56:30 +00:00
|
|
|
cell_info->has_focus = 0;
|
2001-06-27 23:44:53 +00:00
|
|
|
cell_info->attributes = NULL;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
tree_column->cell_list = g_list_append (tree_column->cell_list, cell_info);
|
|
|
|
}
|
2000-10-05 01:04:57 +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
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *cell_info;
|
2000-10-16 06:14:53 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (GTK_IS_CELL_RENDERER (cell));
|
|
|
|
g_return_if_fail (! gtk_tree_view_column_get_cell_info (tree_column, cell));
|
|
|
|
|
|
|
|
g_object_ref (G_OBJECT (cell));
|
2001-08-19 06:58:11 +00:00
|
|
|
gtk_object_sink (GTK_OBJECT (cell));
|
2001-06-27 23:44:53 +00:00
|
|
|
|
|
|
|
cell_info = g_new (GtkTreeViewColumnCellInfo, 1);
|
|
|
|
cell_info->cell = cell;
|
|
|
|
cell_info->expand = expand ? TRUE : FALSE;
|
|
|
|
cell_info->pack = GTK_PACK_END;
|
2001-09-08 00:56:30 +00:00
|
|
|
cell_info->has_focus = 0;
|
2001-06-27 23:44:53 +00:00
|
|
|
cell_info->attributes = NULL;
|
|
|
|
|
|
|
|
tree_column->cell_list = g_list_append (tree_column->cell_list, cell_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
g_return_if_fail (tree_column != NULL);
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data;
|
|
|
|
|
|
|
|
g_object_unref (G_OBJECT (info->cell));
|
|
|
|
gtk_tree_view_column_clear_attributes (tree_column, info->cell);
|
|
|
|
g_free (info);
|
2001-05-16 00:23:30 +00:00
|
|
|
}
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
g_list_free (tree_column->cell_list);
|
|
|
|
tree_column->cell_list = NULL;
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *
|
|
|
|
gtk_tree_view_column_get_cell_renderers (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
|
|
|
{
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *retval = NULL, *list;
|
|
|
|
|
|
|
|
g_return_val_if_fail (tree_column != NULL, NULL);
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *)list->data;
|
|
|
|
|
|
|
|
retval = g_list_append (retval, info->cell);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
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_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)
|
|
|
|
{
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-06-27 23:44:53 +00:00
|
|
|
info = gtk_tree_view_column_get_cell_info (tree_column, cell_renderer);
|
|
|
|
g_return_if_fail (info != NULL);
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
info->attributes = g_slist_prepend (info->attributes, GINT_TO_POINTER (column));
|
|
|
|
info->attributes = g_slist_prepend (info->attributes, g_strdup (attribute));
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_cell_set_dirty (tree_column);
|
2001-05-16 00:23:30 +00:00
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
gchar *attribute;
|
|
|
|
gint column;
|
|
|
|
|
|
|
|
attribute = va_arg (args, gchar *);
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_clear_attributes (tree_column, 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);
|
2001-06-27 23:44:53 +00:00
|
|
|
gtk_tree_view_column_add_attribute (tree_column, 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:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-09-08 06:24:46 +00:00
|
|
|
* @cell_renderer: the #GtkCellRenderer we're setting the attributes of
|
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
|
|
|
* @Varargs: A NULL terminated listing of attributes.
|
2000-10-16 06:14:53 +00:00
|
|
|
*
|
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
|
|
|
|
* @gtk_tree_view_column_add_attribute. All existing attributes
|
|
|
|
* are removed, and replaced with the new attributes.
|
2000-10-16 06:14:53 +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));
|
|
|
|
g_return_if_fail (gtk_tree_view_column_get_cell_info (tree_column, 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
|
2001-02-17 00:16:08 +00:00
|
|
|
* @func: The #GtkTreeViewColumnFunc to use.
|
|
|
|
* @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
|
|
|
|
* cell renderer as appropriate. @func may be NULL to remove an
|
|
|
|
* 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,
|
|
|
|
GtkDestroyNotify destroy)
|
2001-02-17 00:16:08 +00:00
|
|
|
{
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info;
|
|
|
|
|
2001-02-17 00:16:08 +00:00
|
|
|
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));
|
|
|
|
info = gtk_tree_view_column_get_cell_info (tree_column, cell_renderer);
|
|
|
|
|
|
|
|
g_return_if_fail (info != NULL);
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
if (func == info->func &&
|
|
|
|
func_data == info->func_data &&
|
|
|
|
destroy == info->destroy)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
if (info->func_data && info->destroy)
|
|
|
|
(info->destroy) (info->func_data);
|
2001-02-17 00:16:08 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
info->func = func;
|
|
|
|
info->func_data = func_data;
|
|
|
|
info->destroy = destroy;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_cell_set_dirty (tree_column);
|
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-06-27 23:44:53 +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
|
|
|
{
|
2001-06-27 23:44:53 +00:00
|
|
|
GtkTreeViewColumnCellInfo *info;
|
2001-01-11 17:59:40 +00:00
|
|
|
GSList *list;
|
2001-06-27 23:44:53 +00:00
|
|
|
|
2001-01-11 17:59:40 +00:00
|
|
|
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));
|
|
|
|
info = gtk_tree_view_column_get_cell_info (tree_column, cell_renderer);
|
2001-01-11 17:59:40 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
list = info->attributes;
|
2001-01-11 17:59:40 +00:00
|
|
|
|
|
|
|
while (list && list->next)
|
|
|
|
{
|
|
|
|
g_free (list->data);
|
|
|
|
list = list->next->next;
|
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
g_slist_free (info->attributes);
|
|
|
|
info->attributes = NULL;
|
2001-05-16 00:23:30 +00:00
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_cell_set_dirty (tree_column);
|
2001-01-11 17:59:40 +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)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (spacing >= 0);
|
|
|
|
|
|
|
|
if (tree_column->spacing == spacing)
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_column->spacing = spacing;
|
|
|
|
if (tree_column->tree_view)
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_cell_set_dirty (tree_column);
|
2001-06-30 02:38:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_get_spacing:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
*
|
|
|
|
* Returns the spacing of @tree_column.
|
|
|
|
**/
|
|
|
|
gint
|
|
|
|
gtk_tree_view_column_get_spacing (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
|
|
|
|
|
|
|
|
return tree_column->spacing;
|
|
|
|
}
|
|
|
|
|
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.
|
|
|
|
* @visible: TRUE if the @tree_column is visible.
|
|
|
|
*
|
|
|
|
* Sets the visibility of @tree_column.
|
|
|
|
**/
|
2000-10-05 01:04:57 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_visible (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean visible)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
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;
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
if (tree_column->visible == visible)
|
2001-05-16 00:23:30 +00:00
|
|
|
return;
|
2001-03-02 00:49:32 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->visible = visible;
|
2000-10-05 01:04:57 +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.
|
|
|
|
*
|
|
|
|
* Returns TRUE if @tree_column is visible.
|
|
|
|
*
|
|
|
|
* 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);
|
|
|
|
|
|
|
|
return tree_column->visible;
|
|
|
|
}
|
|
|
|
|
2001-11-19 21:18:22 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_resizable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean resizable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
resizable = !! resizable;
|
|
|
|
|
|
|
|
if (tree_column->resizable == resizable)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (resizable && tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
|
|
|
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");
|
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_resizable (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
|
|
|
return tree_column->resizable;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
if (type == tree_column->column_type)
|
|
|
|
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);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* I was clearly on crack when I wrote this. I'm not sure what's supposed to
|
|
|
|
* be below so I'll leave it until I figure it out.
|
|
|
|
*/
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE &&
|
|
|
|
tree_column->requested_width != -1)
|
2000-10-05 01:04:57 +00:00
|
|
|
{
|
2001-05-16 00:23:30 +00:00
|
|
|
gtk_tree_view_column_set_sizing (tree_column, tree_column->requested_width);
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
2001-11-19 21:18:22 +00:00
|
|
|
#endif
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->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);
|
|
|
|
|
|
|
|
return tree_column->column_type;
|
|
|
|
}
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* Returns the current size of the @tree_column in pixels.
|
|
|
|
*
|
2001-09-08 00:56:30 +00:00
|
|
|
* Return value: The current width of the @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);
|
|
|
|
|
2001-01-04 23:36:19 +00:00
|
|
|
return tree_column->width;
|
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_set_fixed_width:
|
2000-10-16 06:14:53 +00:00
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
2001-10-27 00:25:17 +00:00
|
|
|
* @fixed_width: The size to set the @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
|
|
|
|
* type is #GTK_TREE_VIEW_COLUMN_FIXED. In this case, the value is discarded
|
|
|
|
* as the size of the column is based on the calculated width of the column. The
|
2001-01-09 23:24:20 +00:00
|
|
|
* width is clamped to the min/max width for the column.
|
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
|
|
|
{
|
|
|
|
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
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->column_type == GTK_TREE_VIEW_COLUMN_AUTOSIZE)
|
2001-03-05 19:43:24 +00:00
|
|
|
return;
|
|
|
|
|
2001-10-03 13:33:50 +00:00
|
|
|
tree_column->fixed_width = fixed_width;
|
|
|
|
tree_column->requested_width = fixed_width;
|
|
|
|
_gtk_tree_view_column_set_width (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-09-08 00:56:30 +00:00
|
|
|
* Gets the fixed width of the column. This value is only meaning may not be the
|
2001-08-24 20:09:26 +00:00
|
|
|
* 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);
|
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
return tree_column->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)
|
|
|
|
{
|
|
|
|
gint real_min_width;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (min_width >= -1);
|
|
|
|
|
|
|
|
if (min_width == tree_column->min_width)
|
|
|
|
return;
|
|
|
|
|
2001-06-05 15:30:53 +00:00
|
|
|
if (tree_column->tree_view == NULL)
|
|
|
|
{
|
|
|
|
tree_column->min_width = min_width;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2000-10-05 01:04:57 +00:00
|
|
|
real_min_width = (tree_column->min_width == -1) ?
|
|
|
|
tree_column->button->requisition.width : tree_column->min_width;
|
|
|
|
|
|
|
|
/* We want to queue a resize if the either the old min_size or the
|
|
|
|
* new min_size determined the size of the column */
|
2001-06-05 15:30:53 +00:00
|
|
|
if (GTK_WIDGET_REALIZED (tree_column->tree_view))
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
if ((tree_column->min_width > tree_column->width) ||
|
|
|
|
(tree_column->min_width == -1 &&
|
|
|
|
tree_column->button->requisition.width > tree_column->width) ||
|
|
|
|
(min_width > tree_column->width) ||
|
|
|
|
(min_width == -1 &&
|
|
|
|
tree_column->button->requisition.width > tree_column->width))
|
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
}
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->max_width != -1 && tree_column->max_width < real_min_width)
|
2000-10-05 01:04:57 +00:00
|
|
|
tree_column->max_width = real_min_width;
|
|
|
|
|
|
|
|
tree_column->min_width = min_width;
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "min_width");
|
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);
|
|
|
|
|
|
|
|
return tree_column->min_width;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
* fill the view.
|
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)
|
|
|
|
{
|
2001-06-05 15:30:53 +00:00
|
|
|
gint real_max_width;
|
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);
|
|
|
|
|
|
|
|
if (max_width == tree_column->max_width)
|
|
|
|
return;
|
|
|
|
|
2001-06-05 15:30:53 +00:00
|
|
|
if (tree_column->tree_view == NULL)
|
|
|
|
{
|
|
|
|
tree_column->max_width = max_width;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
real_max_width = tree_column->max_width == -1 ?
|
|
|
|
tree_column->button->requisition.width : tree_column->max_width;
|
2000-10-05 01:04:57 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->tree_view &&
|
|
|
|
GTK_WIDGET_REALIZED (tree_column->tree_view) &&
|
2001-01-04 23:36:19 +00:00
|
|
|
((tree_column->max_width < tree_column->width) ||
|
|
|
|
(max_width != -1 && max_width < tree_column->width)))
|
2000-10-05 01:04:57 +00:00
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
|
|
|
|
tree_column->max_width = max_width;
|
|
|
|
|
2001-06-05 15:30:53 +00:00
|
|
|
if (real_max_width > max_width)
|
|
|
|
tree_column->max_width = max_width;
|
2001-01-09 23:24:20 +00:00
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (tree_column), "max_width");
|
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);
|
|
|
|
|
|
|
|
return tree_column->max_width;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
* the user could have conceivably clicked on the button.
|
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)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->visible &&
|
|
|
|
tree_column->button &&
|
|
|
|
tree_column->clickable)
|
|
|
|
gtk_button_clicked (GTK_BUTTON (tree_column->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
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
g_free (tree_column->title);
|
|
|
|
if (title)
|
|
|
|
tree_column->title = g_strdup (title);
|
|
|
|
else
|
|
|
|
tree_column->title = NULL;
|
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.
|
|
|
|
*
|
|
|
|
* Returns the title of the widget. This value should not be modified.
|
|
|
|
*
|
|
|
|
* Return value: the title 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
|
|
|
G_CONST_RETURN 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);
|
|
|
|
|
|
|
|
return tree_column->title;
|
|
|
|
}
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_set_clickable:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @clickable: TRUE if the header is active.
|
|
|
|
*
|
|
|
|
* Sets the header to be active if @active is TRUE. When the header is active,
|
|
|
|
* then it can take keyboard focus, and can be clicked.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_set_clickable (GtkTreeViewColumn *tree_column,
|
|
|
|
gboolean clickable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
if (tree_column->clickable == (clickable?TRUE:FALSE))
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_column->clickable = (clickable?TRUE:FALSE);
|
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.
|
|
|
|
*
|
|
|
|
* Return value: whether the user can click the column header
|
|
|
|
**/
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_get_clickable (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return tree_column->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.
|
|
|
|
* @widget: A child #GtkWidget, or NULL.
|
|
|
|
*
|
|
|
|
* Sets the widget in the header to be @widget. If widget is NULL, then the
|
|
|
|
* 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)
|
|
|
|
{
|
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
|
|
|
|
|
|
|
if (widget)
|
|
|
|
{
|
2001-01-19 22:39:19 +00:00
|
|
|
gtk_object_ref (GTK_OBJECT (widget));
|
|
|
|
gtk_object_sink (GTK_OBJECT (widget));
|
2000-10-05 01:04:57 +00:00
|
|
|
}
|
|
|
|
|
2001-01-19 22:39:19 +00:00
|
|
|
if (tree_column->child)
|
|
|
|
gtk_object_unref (GTK_OBJECT (tree_column->child));
|
|
|
|
|
|
|
|
tree_column->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.
|
|
|
|
*
|
|
|
|
* Returns the #GtkWidget in the button in the column header. If a custom
|
|
|
|
* widget has not been set, then this will be a #GtkAlignment with a #GtkLabel
|
|
|
|
* in it.
|
|
|
|
*
|
|
|
|
* Return value: The #GtkWidget in the column header.
|
|
|
|
**/
|
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);
|
|
|
|
|
2001-01-19 22:39:19 +00:00
|
|
|
return tree_column->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
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
2001-09-25 19:38:18 +00:00
|
|
|
xalign = CLAMP (xalign, 0.0, 1.0);
|
|
|
|
|
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
|
|
|
if (tree_column->xalign == xalign)
|
2000-10-05 01:04:57 +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
|
|
|
tree_column->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
|
|
|
|
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
|
|
|
return tree_column->xalign;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
{
|
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
|
|
|
|
2001-05-22 19:18:47 +00:00
|
|
|
/* if (reorderable)
|
|
|
|
gtk_tree_view_column_set_clickable (tree_column, TRUE);*/
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (tree_column->reorderable == (reorderable?TRUE:FALSE))
|
|
|
|
return;
|
|
|
|
|
|
|
|
tree_column->reorderable = (reorderable?TRUE:FALSE);
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
return tree_column->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
|
|
|
|
* @sort_column_id: The sort_column_id of the model to sort on.
|
|
|
|
*
|
2001-08-21 03:53:13 +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)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (sort_column_id >= 0);
|
|
|
|
|
|
|
|
if (tree_column->sort_column_id == sort_column_id)
|
|
|
|
return;
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->sort_column_id = sort_column_id;
|
|
|
|
|
|
|
|
/* Handle unsetting the id */
|
2001-03-28 01:54:14 +00:00
|
|
|
if (sort_column_id == -1)
|
|
|
|
{
|
2001-03-29 21:30:05 +00:00
|
|
|
if (tree_column->sort_clicked_signal)
|
2001-05-16 00:23:30 +00:00
|
|
|
{
|
|
|
|
g_signal_handler_disconnect (G_OBJECT (tree_column), tree_column->sort_clicked_signal);
|
|
|
|
tree_column->sort_clicked_signal = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tree_column->sort_column_changed_signal)
|
|
|
|
{
|
|
|
|
g_signal_handler_disconnect (G_OBJECT (tree_column), tree_column->sort_column_changed_signal);
|
|
|
|
tree_column->sort_column_changed_signal = 0;
|
|
|
|
}
|
|
|
|
|
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);
|
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);
|
|
|
|
|
2001-03-29 21:30:05 +00:00
|
|
|
if (! tree_column->sort_clicked_signal)
|
2001-06-29 16:30:25 +00:00
|
|
|
tree_column->sort_clicked_signal = g_signal_connect (G_OBJECT (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);
|
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
|
|
|
|
*
|
|
|
|
* Gets the logical sort_column_id that the model sorts on when this
|
|
|
|
* coumn is selected for sorting. See gtk_tree_view_column_set_sort_column_id().
|
|
|
|
*
|
|
|
|
* Return value: the current sort_column_id for this column, or -1 if
|
|
|
|
* 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);
|
|
|
|
|
|
|
|
return tree_column->sort_column_id;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (setting == tree_column->show_sort_indicator)
|
|
|
|
return;
|
2001-03-29 21:30:05 +00:00
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->show_sort_indicator = setting;
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
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);
|
|
|
|
|
|
|
|
return tree_column->show_sort_indicator;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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));
|
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
if (order == tree_column->sort_order)
|
|
|
|
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
|
|
|
|
2001-05-16 00:23:30 +00:00
|
|
|
tree_column->sort_order = order;
|
|
|
|
gtk_tree_view_column_update_button (tree_column);
|
|
|
|
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
|
|
|
|
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
|
|
|
return tree_column->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-08-19 04:19:56 +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
|
|
|
*
|
|
|
|
* Sets the cell renderer based on the @tree_model and @tree_node. That is, for
|
|
|
|
* every attribute mapping in @tree_column, it will get a value from the set
|
|
|
|
* column on the @tree_node, and use that value to set the attribute on the cell
|
|
|
|
* renderer. This is used primarily by the GtkTreeView.
|
|
|
|
**/
|
|
|
|
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
|
|
|
{
|
|
|
|
GSList *list;
|
|
|
|
GValue value = { 0, };
|
2001-06-27 23:44:53 +00:00
|
|
|
GList *cell_list;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
2001-06-27 23:44:53 +00:00
|
|
|
g_return_if_fail (tree_column->cell_list != NULL);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
|
|
|
if (tree_model == NULL)
|
|
|
|
return;
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
for (cell_list = tree_column->cell_list; cell_list; cell_list = cell_list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) cell_list->data;
|
|
|
|
GObject *cell = (GObject *) info->cell;
|
|
|
|
|
|
|
|
list = info->attributes;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
g_object_freeze_notify (cell);
|
2001-08-19 04:19:56 +00:00
|
|
|
g_object_set (cell, "is_expander", is_expander, "is_expanded", is_expanded, NULL);
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
while (list && list->next)
|
|
|
|
{
|
|
|
|
gtk_tree_model_get_value (tree_model, iter,
|
|
|
|
GPOINTER_TO_INT (list->next->data),
|
|
|
|
&value);
|
|
|
|
g_object_set_property (cell, (gchar *) list->data, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
list = list->next->next;
|
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
if (info->func)
|
|
|
|
(* info->func) (tree_column, info->cell, tree_model, iter, info->func_data);
|
|
|
|
g_object_thaw_notify (G_OBJECT (info->cell));
|
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.
|
|
|
|
* @cell_area: The area a the column will be allocated, or %NULL
|
|
|
|
* @x_offset: location to return x offset of cell relative to @cell_area, or %NULL
|
|
|
|
* @y_offset: location to return y offset of cell relative to @cell_area, or %NULL
|
|
|
|
* @width: location to return width needed to render a cell, or %NULL
|
|
|
|
* @height: location to return height needed to render a cell, or %NULL
|
|
|
|
*
|
|
|
|
* Obtains the width and height needed to render the column. This is used
|
|
|
|
* primarily by the GtkTreeView.
|
|
|
|
**/
|
|
|
|
void
|
2001-09-08 00:56:30 +00:00
|
|
|
gtk_tree_view_column_cell_get_size (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
gint *x_offset,
|
|
|
|
gint *y_offset,
|
|
|
|
gint *width,
|
|
|
|
gint *height)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
gboolean first_cell = TRUE;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
|
|
|
|
if (height)
|
|
|
|
* height = 0;
|
|
|
|
if (width)
|
|
|
|
* width = 0;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
gboolean visible;
|
|
|
|
gint new_height = 0;
|
|
|
|
gint new_width = 0;
|
|
|
|
g_object_get (info->cell, "visible", &visible, NULL);
|
|
|
|
|
|
|
|
if (visible == FALSE)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (first_cell == FALSE && *width)
|
|
|
|
*width += tree_column->spacing;
|
|
|
|
|
|
|
|
gtk_cell_renderer_get_size (info->cell,
|
|
|
|
tree_column->tree_view,
|
|
|
|
cell_area,
|
|
|
|
x_offset,
|
|
|
|
y_offset,
|
|
|
|
&new_width,
|
|
|
|
&new_height);
|
|
|
|
|
|
|
|
if (height)
|
|
|
|
* height = MAX (*height, new_height);
|
|
|
|
info->requested_width = MAX (info->requested_width, new_width);
|
|
|
|
if (width)
|
|
|
|
* width += info->requested_width;
|
|
|
|
first_cell = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
/* both rendering and rendering focus are somewhat complicated, and a bit of
|
|
|
|
* code. Rather than duplicate them, we put them together to keep the code in
|
|
|
|
* one place
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
gtk_tree_view_column_cell_render_or_focus (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkRectangle *background_area,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
GdkRectangle *expose_area,
|
|
|
|
guint flags,
|
|
|
|
gboolean render,
|
|
|
|
GdkRectangle *focus_rectangle)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2001-09-08 00:56:30 +00:00
|
|
|
GList *list;
|
|
|
|
GdkRectangle real_cell_area;
|
|
|
|
gint expand_cell_count = 0;
|
|
|
|
gint full_requested_width = 0;
|
|
|
|
gint extra_space;
|
2001-09-25 16:44:39 +00:00
|
|
|
gint min_x, min_y, max_x, max_y;
|
2001-09-08 00:56:30 +00:00
|
|
|
|
2001-09-25 16:44:39 +00:00
|
|
|
min_x = G_MAXINT;
|
|
|
|
min_y = G_MAXINT;
|
|
|
|
max_x = 0;
|
|
|
|
max_y = 0;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
real_cell_area = *cell_area;
|
2001-09-25 16:44:39 +00:00
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
/* Find out how my extra space we have to allocate */
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
g_object_get (info->cell, "visible", &visible, NULL);
|
|
|
|
if (visible == FALSE)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (info->expand == TRUE)
|
|
|
|
expand_cell_count ++;
|
|
|
|
full_requested_width += info->requested_width;
|
|
|
|
}
|
|
|
|
|
|
|
|
extra_space = cell_area->width - full_requested_width;
|
|
|
|
if (extra_space < 0)
|
|
|
|
extra_space = 0;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_END)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
g_object_get (info->cell, "visible", &visible, NULL);
|
|
|
|
if (visible == FALSE)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
real_cell_area.width = info->requested_width +
|
|
|
|
(info->expand?extra_space:0);
|
2001-09-25 16:44:39 +00:00
|
|
|
if (render)
|
|
|
|
{
|
|
|
|
gtk_cell_renderer_render (info->cell,
|
|
|
|
window,
|
|
|
|
tree_column->tree_view,
|
|
|
|
background_area,
|
|
|
|
&real_cell_area,
|
|
|
|
expose_area,
|
|
|
|
flags);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gint x_offset, y_offset, width, height;
|
|
|
|
|
|
|
|
gtk_cell_renderer_get_size (info->cell,
|
|
|
|
tree_column->tree_view,
|
|
|
|
&real_cell_area,
|
|
|
|
&x_offset, &y_offset,
|
|
|
|
&width, &height);
|
|
|
|
|
|
|
|
if (min_x > (real_cell_area.x + x_offset))
|
|
|
|
min_x = real_cell_area.x + x_offset;
|
|
|
|
if (max_x < real_cell_area.x + x_offset + width)
|
|
|
|
max_x = real_cell_area.x + x_offset + width;
|
|
|
|
if (min_y > (real_cell_area.y + y_offset))
|
|
|
|
min_y = real_cell_area.y + y_offset;
|
|
|
|
if (max_y < real_cell_area.y + y_offset + height)
|
|
|
|
max_y = real_cell_area.y + y_offset + height;
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
real_cell_area.x += (info->requested_width + tree_column->spacing);
|
|
|
|
}
|
|
|
|
for (list = g_list_last (tree_column->cell_list); list; list = list->prev)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
if (info->pack == GTK_PACK_START)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
g_object_get (info->cell, "visible", &visible, NULL);
|
|
|
|
if (visible == FALSE)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
real_cell_area.width = info->requested_width +
|
|
|
|
(info->expand?extra_space:0);
|
|
|
|
gtk_cell_renderer_render (info->cell,
|
|
|
|
window,
|
|
|
|
tree_column->tree_view,
|
|
|
|
background_area,
|
|
|
|
&real_cell_area,
|
|
|
|
expose_area,
|
|
|
|
flags);
|
|
|
|
real_cell_area.x += (info->requested_width + tree_column->spacing);
|
|
|
|
}
|
2001-09-25 16:44:39 +00:00
|
|
|
if (! render)
|
|
|
|
{
|
|
|
|
if (min_x >= max_x || min_y >= max_y)
|
|
|
|
{
|
|
|
|
*focus_rectangle = *cell_area;
|
|
|
|
focus_rectangle->x -= 1;
|
|
|
|
focus_rectangle->y -= 1;
|
|
|
|
focus_rectangle->width += 2;
|
|
|
|
focus_rectangle->height += 2;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
focus_rectangle->x = min_x - 1;
|
|
|
|
focus_rectangle->y = min_y - 1;
|
|
|
|
focus_rectangle->width = (max_x - min_x) + 2;
|
|
|
|
focus_rectangle->height = (max_y - min_y) + 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gtk_tree_view_column_cell_render:
|
|
|
|
* @tree_column: A #GtkTreeViewColumn.
|
|
|
|
* @window: a #GdkDrawable to draw to
|
|
|
|
* @background_area: entire cell area (including tree expanders and maybe padding on the sides)
|
|
|
|
* @cell_area: area normally rendered by a cell renderer
|
|
|
|
* @expose_area: area that actually needs updating
|
|
|
|
* @flags: flags that affect rendering
|
|
|
|
*
|
|
|
|
* Renders the cell contained by #tree_column. This is used primarily by the
|
|
|
|
* GtkTreeView.
|
|
|
|
**/
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_cell_render (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkRectangle *background_area,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
GdkRectangle *expose_area,
|
|
|
|
guint flags)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
g_return_if_fail (background_area != NULL);
|
|
|
|
g_return_if_fail (cell_area != NULL);
|
|
|
|
g_return_if_fail (expose_area != NULL);
|
|
|
|
|
|
|
|
gtk_tree_view_column_cell_render_or_focus (tree_column,
|
|
|
|
window,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
expose_area,
|
|
|
|
flags,
|
|
|
|
TRUE,
|
|
|
|
NULL);
|
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,
|
|
|
|
GtkCellEditable **editable_widget,
|
|
|
|
GdkEvent *event,
|
|
|
|
gchar *path_string,
|
|
|
|
GdkRectangle *background_area,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
guint flags)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2001-09-18 17:52:42 +00:00
|
|
|
gboolean visible, mode;
|
2001-05-25 23:10:49 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
g_object_get (G_OBJECT (((GtkTreeViewColumnCellInfo *) tree_column->cell_list->data)->cell),
|
2001-05-25 23:10:49 +00:00
|
|
|
"visible", &visible,
|
2001-09-18 17:52:42 +00:00
|
|
|
"mode", &mode,
|
2001-05-25 23:10:49 +00:00
|
|
|
NULL);
|
2001-09-18 17:52:42 +00:00
|
|
|
if (visible && mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)
|
2001-05-25 23:10:49 +00:00
|
|
|
{
|
2001-09-17 21:44:20 +00:00
|
|
|
if (gtk_cell_renderer_activate (((GtkTreeViewColumnCellInfo *) tree_column->cell_list->data)->cell,
|
|
|
|
event,
|
|
|
|
tree_column->tree_view,
|
|
|
|
path_string,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
flags))
|
2001-05-25 23:10:49 +00:00
|
|
|
return TRUE;
|
2001-09-18 16:15:10 +00:00
|
|
|
}
|
2001-09-18 17:52:42 +00:00
|
|
|
else if (visible && mode == GTK_CELL_RENDERER_MODE_EDITABLE)
|
2001-09-18 16:15:10 +00:00
|
|
|
{
|
|
|
|
*editable_widget = gtk_cell_renderer_start_editing (((GtkTreeViewColumnCellInfo *) tree_column->cell_list->data)->cell,
|
|
|
|
event,
|
|
|
|
tree_column->tree_view,
|
|
|
|
path_string,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
flags);
|
2001-09-25 16:44:39 +00:00
|
|
|
|
|
|
|
if (*editable_widget != NULL)
|
|
|
|
{
|
|
|
|
g_return_val_if_fail (GTK_IS_CELL_EDITABLE (*editable_widget), FALSE);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2001-05-25 23:10:49 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
|
2001-09-08 00:56:30 +00:00
|
|
|
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_cell_focus (GtkTreeViewColumn *tree_column,
|
2001-09-25 16:44:39 +00:00
|
|
|
gint direction)
|
2001-09-08 00:56:30 +00:00
|
|
|
{
|
2001-09-25 16:44:39 +00:00
|
|
|
if (GTK_TREE_VIEW (tree_column->tree_view)->priv->focus_column == tree_column)
|
|
|
|
return FALSE;
|
2001-09-17 21:44:20 +00:00
|
|
|
return TRUE;
|
2001-09-08 00:56:30 +00:00
|
|
|
}
|
|
|
|
|
2001-09-17 21:44:20 +00:00
|
|
|
void
|
|
|
|
gtk_tree_view_column_cell_draw_focus (GtkTreeViewColumn *tree_column,
|
|
|
|
GdkWindow *window,
|
|
|
|
GdkRectangle *background_area,
|
|
|
|
GdkRectangle *cell_area,
|
|
|
|
GdkRectangle *expose_area,
|
|
|
|
guint flags)
|
|
|
|
{
|
2001-09-25 16:44:39 +00:00
|
|
|
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
|
|
|
|
if (tree_column->editable_widget)
|
|
|
|
{
|
|
|
|
/* This function is only called on the editable row when editing.
|
|
|
|
*/
|
|
|
|
|
|
|
|
gtk_paint_focus (tree_column->tree_view->style,
|
|
|
|
window,
|
2001-12-04 03:27:30 +00:00
|
|
|
GTK_WIDGET_STATE (tree_column->tree_view),
|
2001-09-25 16:44:39 +00:00
|
|
|
NULL,
|
|
|
|
tree_column->tree_view,
|
|
|
|
"treeview",
|
|
|
|
cell_area->x - 1,
|
|
|
|
cell_area->y - 1,
|
2001-12-04 03:27:30 +00:00
|
|
|
cell_area->width + 2,
|
|
|
|
cell_area->height + 2);
|
2001-09-25 16:44:39 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GdkRectangle focus_rectangle;
|
|
|
|
gtk_tree_view_column_cell_render_or_focus (tree_column,
|
|
|
|
window,
|
|
|
|
background_area,
|
|
|
|
cell_area,
|
|
|
|
expose_area,
|
|
|
|
flags,
|
|
|
|
FALSE,
|
|
|
|
&focus_rectangle);
|
|
|
|
|
|
|
|
gtk_paint_focus (tree_column->tree_view->style,
|
|
|
|
window,
|
2001-12-04 03:27:30 +00:00
|
|
|
GTK_WIDGET_STATE (tree_column->tree_view),
|
2001-09-25 16:44:39 +00:00
|
|
|
NULL,
|
|
|
|
tree_column->tree_view,
|
|
|
|
"treeview",
|
|
|
|
focus_rectangle.x,
|
|
|
|
focus_rectangle.y,
|
2001-12-04 03:27:30 +00:00
|
|
|
focus_rectangle.width,
|
|
|
|
focus_rectangle.height);
|
2001-09-25 16:44:39 +00:00
|
|
|
}
|
2001-06-27 23:44:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
gtk_tree_view_column_cell_is_visible (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
2001-09-08 00:56:30 +00:00
|
|
|
gboolean visible;
|
|
|
|
|
|
|
|
g_object_get (G_OBJECT (info->cell), "visible", &visible, NULL);
|
|
|
|
|
2001-06-27 23:44:53 +00:00
|
|
|
if (visible)
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-09-08 00:56:30 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
gtk_tree_view_column_cell_set_dirty (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
GList *list;
|
|
|
|
|
|
|
|
for (list = tree_column->cell_list; list; list = list->next)
|
|
|
|
{
|
|
|
|
GtkTreeViewColumnCellInfo *info = (GtkTreeViewColumnCellInfo *) list->data;
|
|
|
|
|
|
|
|
info->requested_width = 0;
|
|
|
|
}
|
|
|
|
tree_column->dirty = TRUE;
|
|
|
|
|
|
|
|
if (tree_column->tree_view)
|
|
|
|
gtk_widget_queue_resize (tree_column->tree_view);
|
|
|
|
}
|
|
|
|
|
2001-09-18 22:49:02 +00:00
|
|
|
void
|
|
|
|
_gtk_tree_view_column_start_editing (GtkTreeViewColumn *tree_column,
|
|
|
|
GtkCellEditable *cell_editable)
|
|
|
|
{
|
|
|
|
g_return_if_fail (tree_column->editable_widget == NULL);
|
|
|
|
|
|
|
|
tree_column->editable_widget = cell_editable;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_tree_view_column_stop_editing (GtkTreeViewColumn *tree_column)
|
|
|
|
{
|
|
|
|
g_return_if_fail (tree_column->editable_widget != NULL);
|
|
|
|
|
|
|
|
tree_column->editable_widget = NULL;
|
|
|
|
}
|