summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-02-08 23:36:53 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-02-08 23:36:53 +0000
commit4a3c8a367a012a1e098934585d46db8611e12420 (patch)
tree8d94100a2edcec233c24665e82b906f222a97c46 /tests
parentea6096cc53f3e23dbe3d9adf33486126077ea94e (diff)
downloadgdk-pixbuf-4a3c8a367a012a1e098934585d46db8611e12420.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/testtreeview.c59
1 files changed, 57 insertions, 2 deletions
diff --git a/tests/testtreeview.c b/tests/testtreeview.c
index 5ffcecb25..226d9017a 100644
--- a/tests/testtreeview.c
+++ b/tests/testtreeview.c
@@ -261,12 +261,17 @@ set_columns_type (GtkTreeView *tree_view, ColumnsType type)
col = gtk_tree_view_get_column (tree_view, 0);
}
+ gtk_tree_view_set_rules_hint (tree_view, FALSE);
+
switch (type)
{
case COLUMNS_NONE:
break;
- case COLUMNS_LOTS:
+ case COLUMNS_LOTS:
+ /* with lots of columns we need to turn on rules */
+ gtk_tree_view_set_rules_hint (tree_view, TRUE);
+
rend = gtk_cell_renderer_text_new ();
col = gtk_tree_view_column_new_with_attributes ("Column 1",
@@ -691,7 +696,7 @@ main (int argc,
gtk_container_add (GTK_CONTAINER (window), table);
tv = gtk_tree_view_new_with_model (models[0]);
-
+
gtk_tree_view_set_rows_drag_source (GTK_TREE_VIEW (tv),
GDK_BUTTON1_MASK,
row_targets,
@@ -1374,6 +1379,28 @@ int_changed (GObject *object, GParamSpec *pspec, gpointer data)
g_value_unset (&val);
}
+static void
+float_modified (GtkAdjustment *adj, gpointer data)
+{
+ ObjectProperty *p = data;
+
+ g_object_set (p->obj, p->prop, (float) adj->value, NULL);
+}
+
+static void
+float_changed (GObject *object, GParamSpec *pspec, gpointer data)
+{
+ GtkAdjustment *adj = GTK_ADJUSTMENT (data);
+ GValue val = { 0, };
+
+ g_value_init (&val, G_TYPE_FLOAT);
+ g_object_get_property (object, pspec->name, &val);
+
+ if (g_value_get_float (&val) != (float) adj->value)
+ gtk_adjustment_set_value (adj, g_value_get_float (&val));
+
+ g_value_unset (&val);
+}
static void
string_modified (GtkEntry *entry, gpointer data)
@@ -1559,6 +1586,34 @@ create_prop_editor (GObject *object)
object, spec->name, (GtkSignalFunc) int_modified);
break;
+ case G_TYPE_FLOAT:
+ hbox = gtk_hbox_new (FALSE, 10);
+ label = gtk_label_new (spec->nick);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+ adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_FLOAT (spec)->default_value,
+ G_PARAM_SPEC_FLOAT (spec)->minimum,
+ G_PARAM_SPEC_FLOAT (spec)->maximum,
+ 0.1,
+ MAX ((G_PARAM_SPEC_FLOAT (spec)->maximum -
+ G_PARAM_SPEC_FLOAT (spec)->minimum) / 10, 0.1),
+ 0.0));
+
+ prop_edit = gtk_spin_button_new (adj, 0.1, 2);
+
+ gtk_box_pack_end (GTK_BOX (hbox), prop_edit, FALSE, FALSE, 0);
+
+ gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+
+ g_object_connect_property (object, spec->name,
+ GTK_SIGNAL_FUNC (float_changed),
+ adj, G_OBJECT (adj));
+
+ if (can_modify)
+ connect_controller (G_OBJECT (adj), "value_changed",
+ object, spec->name, (GtkSignalFunc) float_modified);
+ break;
+
case G_TYPE_STRING:
hbox = gtk_hbox_new (FALSE, 10);
label = gtk_label_new (spec->nick);