[gtk+/extended-layout-jhs: 42/64] Add paned widgets to the natural size test for GtkAlignment and GtkSocket.
- From: Johannes Schmid <jhs src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/extended-layout-jhs: 42/64] Add paned widgets to the natural size test for GtkAlignment and GtkSocket.
- Date: Wed, 25 Nov 2009 11:22:26 +0000 (UTC)
commit b9bc59174f424f98a52157d5f658c68ccaab2304
Author: Mathias Hasselmann <mathias hasselmann gmx de>
Date: Fri Jul 27 23:06:19 2007 +0000
Add paned widgets to the natural size test for GtkAlignment and GtkSocket.
2007-07-27 Mathias Hasselmann <mathias hasselmann gmx de>
* tests/testextendedlayout.c: Add paned widgets to
the natural size test for GtkAlignment and GtkSocket.
* gtk/gtksocket-x11.c: Fix some cast.
svn path=/branches/extended-layout/; revision=18553
ChangeLog.gtk-extended-layout | 6 ++++++
gtk/gtksocket-x11.c | 2 +-
tests/testextendedlayout.c | 34 +++++++++++++++++++++++++---------
3 files changed, 32 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog.gtk-extended-layout b/ChangeLog.gtk-extended-layout
index d999fd4..cfe999e 100644
--- a/ChangeLog.gtk-extended-layout
+++ b/ChangeLog.gtk-extended-layout
@@ -1,5 +1,11 @@
2007-07-27 Mathias Hasselmann <mathias hasselmann gmx de>
+ * tests/testextendedlayout.c: Add paned widgets to
+ the natural size test for GtkAlignment and GtkSocket.
+ * gtk/gtksocket-x11.c: Fix some cast.
+
+2007-07-27 Mathias Hasselmann <mathias hasselmann gmx de>
+
* gtk/gtkalignment.c, gtk/gtksocket.c, gtk/gtksocket-x11.c,
gtk/gtksocketprivate.h: Consider natural size of the child.
* gtk/gtkplug.c, gtk/gtkplug-x11.c, gtk/gtkplugprivate.h:
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index 06c063a..393974e 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -164,7 +164,7 @@ _gtk_socket_windowing_get_natural_size (GtkSocket *socket)
return;
}
- data_long = (long*) data;
+ data_long = (gint32*) data;
priv->natural_width = MAX (1, data_long[0]);
priv->natural_height = MAX (1, data_long[1]);
diff --git a/tests/testextendedlayout.c b/tests/testextendedlayout.c
index d18cda1..c860d17 100644
--- a/tests/testextendedlayout.c
+++ b/tests/testextendedlayout.c
@@ -468,7 +468,7 @@ static TestCase*
create_natural_socket_size_test (TestSuite *suite,
gchar *arg0)
{
- GtkWidget *box, *label, *align, *child, *plug;
+ GtkWidget *box, *paned, *label, *align, *child, *plug;
GdkNativeWindow plug_id;
TestCase *test;
@@ -481,22 +481,37 @@ create_natural_socket_size_test (TestSuite *suite,
gint i, j;
test = test_case_new (suite, "Natural Size", "GtkAlignment, GtkSocket",
- gtk_alignment_new (0.5, 0.5, 0.6, 0.0));
-
- box = gtk_vbox_new (FALSE, 12);
+ gtk_vbox_new (FALSE, 12));
gtk_container_set_border_width (GTK_CONTAINER (test->widget), 6);
- gtk_container_add (GTK_CONTAINER (test->widget), box);
for (orientation = 0; orientation < 2; ++orientation)
{
+ label = gtk_label_new ("Move the handle to test\n"
+ "natural size allocation");
+ gtk_misc_set_padding (GTK_MISC (label), 6, 6);
+
if (orientation)
{
- child = gtk_hbox_new (FALSE, 12);
- gtk_box_pack_end (GTK_BOX (box), child, FALSE, TRUE, 0);
- gtk_box_pack_end (GTK_BOX (box), gtk_hseparator_new (), FALSE, TRUE, 0);
- box = child;
+ gtk_box_pack_start (GTK_BOX (test->widget),
+ gtk_hseparator_new (),
+ FALSE, TRUE, 0);
+
+ paned = gtk_vpaned_new ();
+ box = gtk_hbox_new (FALSE, 12);
+ gtk_misc_set_alignment (GTK_MISC (label), 0.5, 1.0);
}
+ else
+ {
+ paned = gtk_hpaned_new ();
+ box = gtk_vbox_new (FALSE, 12);
+ gtk_label_set_angle (GTK_LABEL (label), -90);
+ gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+ }
+
+ gtk_paned_pack1 (GTK_PANED (paned), box, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (paned), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (test->widget), paned, TRUE, TRUE, 0);
for (type = 0; type < 3; ++type)
{
@@ -506,6 +521,7 @@ create_natural_socket_size_test (TestSuite *suite,
type > 0 ? "<b>GtkSocket with GtkPlug</b>" :
"<b>GtkAligment</b>");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, TRUE, 0);
if (orientation)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]