Commit 7cf20b2f authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

Added wrapbox subdir to libegg, still need to fix Makefiles for GTK+ 3.0

parent d7fe4050
all: testwrapbox
testwrapbox:testwrapbox.c eggwrapbox.o
gcc -Wall -o $@ -g $^ `pkg-config --cflags --libs gtk+-3.0`
eggwrapbox.o: eggwrapbox.c eggwrapbox.h
gcc -Wall -o $@ -g -c eggwrapbox.c `pkg-config --cflags gtk+-3.0`
clean:
rm -f testwrapbox *.o *.so *~
This diff is collapsed.
/*
* Copyright (C) 2010 Openismus GmbH
*
* Authors:
* Tristan Van Berkom <tristanvb@openismus.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.
*/
#ifndef __EGG_WRAP_BOX_H__
#define __EGG_WRAP_BOX_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define EGG_TYPE_WRAP_BOX (egg_wrap_box_get_type ())
#define EGG_WRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_WRAP_BOX, EggWrapBox))
#define EGG_WRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_WRAP_BOX, EggWrapBoxClass))
#define EGG_IS_WRAP_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_WRAP_BOX))
#define EGG_IS_WRAP_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_WRAP_BOX))
#define EGG_WRAP_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_WRAP_BOX, EggWrapBoxClass))
typedef struct _EggWrapBox EggWrapBox;
typedef struct _EggWrapBoxPrivate EggWrapBoxPrivate;
typedef struct _EggWrapBoxClass EggWrapBoxClass;
/**
* EggWrapAllocationMode:
* @EGG_WRAP_ALLOCATE_FREE: Items wrap freely in the box's orientation
* @EGG_WRAP_ALLOCATE_ALIGNED: Items are aligned into rows and columns
* @EGG_WRAP_ALLOCATE_HOMOGENEOUS: Items are all allocated the same size
*
* Describes how an #EggWrapBox positions its children.
*/
typedef enum {
EGG_WRAP_ALLOCATE_FREE = 0,
EGG_WRAP_ALLOCATE_ALIGNED,
EGG_WRAP_ALLOCATE_HOMOGENEOUS
} EggWrapAllocationMode;
/**
* EggWrapBoxSpreading:
* @EGG_WRAP_BOX_SPREAD_START: Children are allocated no more than their natural size
* in the given orientation and any extra space is left trailing at
* the end of each row/column.
* @EGG_WRAP_BOX_SPREAD_END: Children are allocated no more than their natural size
* in the given orientation and any extra space skipped at the beginning
* of each row/column.
* @EGG_WRAP_BOX_SPREAD_EVEN: Children are allocated no more than their natural size
* in the given orientation and any extra space is evenly distributed
* as empty space between children.
* @EGG_WRAP_BOX_SPREAD_EXPAND: Extra space is given to children which asked to expand in the given
* orientation (or columns/rows which contain children who asked to expand).
* If no children asked to expand; extra space is distributed evenly.
*
* Describes how a #EggWrapBox deals with extra space in a given orientation when allocating children.
*/
typedef enum {
EGG_WRAP_BOX_SPREAD_START = 0,
EGG_WRAP_BOX_SPREAD_END,
EGG_WRAP_BOX_SPREAD_EVEN,
EGG_WRAP_BOX_SPREAD_EXPAND
} EggWrapBoxSpreading;
/**
* EggWrapBoxPacking:
* @EGG_WRAP_BOX_H_EXPAND: Whether the child expands horizontally.
* @EGG_WRAP_BOX_V_EXPAND: Whether the child expands vertically.
*
* Specifies how widgets will expand vertically and
* horizontally when placed inside a #EggWrapBox.
*/
typedef enum
{
EGG_WRAP_BOX_H_EXPAND = 1 << 0,
EGG_WRAP_BOX_V_EXPAND = 1 << 1
} EggWrapBoxPacking;
struct _EggWrapBox
{
GtkContainer container;
/*< private >*/
EggWrapBoxPrivate *priv;
};
struct _EggWrapBoxClass
{
GtkContainerClass parent_class;
};
GType egg_wrap_box_get_type (void) G_GNUC_CONST;
GtkWidget *egg_wrap_box_new (EggWrapAllocationMode mode,
EggWrapBoxSpreading horizontal_spreading,
EggWrapBoxSpreading vertical_spreading,
guint horizontal_spacing,
guint vertical_spacing);
void egg_wrap_box_set_allocation_mode (EggWrapBox *box,
EggWrapAllocationMode mode);
EggWrapAllocationMode egg_wrap_box_get_allocation_mode (EggWrapBox *box);
void egg_wrap_box_set_horizontal_spreading (EggWrapBox *box,
EggWrapBoxSpreading spreading);
EggWrapBoxSpreading egg_wrap_box_get_horizontal_spreading (EggWrapBox *box);
void egg_wrap_box_set_vertical_spreading (EggWrapBox *box,
EggWrapBoxSpreading spreading);
EggWrapBoxSpreading egg_wrap_box_get_vertical_spreading (EggWrapBox *box);
void egg_wrap_box_set_vertical_spacing (EggWrapBox *box,
guint spacing);
guint egg_wrap_box_get_vertical_spacing (EggWrapBox *box);
void egg_wrap_box_set_horizontal_spacing (EggWrapBox *box,
guint spacing);
guint egg_wrap_box_get_horizontal_spacing (EggWrapBox *box);
void egg_wrap_box_set_minimum_line_children (EggWrapBox *box,
guint n_children);
guint egg_wrap_box_get_minimum_line_children (EggWrapBox *box);
void egg_wrap_box_set_natural_line_children (EggWrapBox *box,
guint n_children);
guint egg_wrap_box_get_natural_line_children (EggWrapBox *box);
void egg_wrap_box_insert_child (EggWrapBox *box,
GtkWidget *widget,
gint index,
EggWrapBoxPacking packing);
void egg_wrap_box_reorder_child (EggWrapBox *box,
GtkWidget *widget,
guint index);
G_END_DECLS
#endif /* __EGG_WRAP_BOX_H__ */
/* testwrapbox.c
* Copyright (C) 2010 Openismus GmbH
*
* Author:
* Tristan Van Berkom <tristanvb@openismus.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 <gtk/gtk.h>
#include "eggwrapbox.h"
enum {
SIMPLE_ITEMS = 0,
WRAPPY_ITEMS,
STOCK_ITEMS
};
#define INITIAL_ALLOCATION_MODE EGG_WRAP_ALLOCATE_HOMOGENEOUS
#define INITIAL_SPREADING EGG_WRAP_BOX_SPREAD_START
#define INITIAL_MINIMUM_LENGTH 3
#define INITIAL_HSPACING 2
#define INITIAL_VSPACING 2
static EggWrapBox *the_wrapbox = NULL;
static gint items_type = SIMPLE_ITEMS;
static GtkOrientation text_orientation = GTK_ORIENTATION_HORIZONTAL;
static gboolean items_xexpand = TRUE;
static gboolean items_yexpand = TRUE;
static void
populate_wrapbox_simple (EggWrapBox *wrapbox)
{
GtkWidget *widget, *frame;
gint i;
for (i = 0; i < 30; i++)
{
gchar *text = g_strdup_printf ("Item %02d", i);
widget = gtk_label_new (text);
frame = gtk_frame_new (NULL);
gtk_widget_show (widget);
gtk_widget_show (frame);
gtk_container_add (GTK_CONTAINER (frame), widget);
if (text_orientation == GTK_ORIENTATION_VERTICAL)
gtk_label_set_angle (GTK_LABEL (widget), 90);
egg_wrap_box_insert_child (EGG_WRAP_BOX (wrapbox), frame, -1,
(items_xexpand ? EGG_WRAP_BOX_H_EXPAND : 0) |
(items_yexpand ? EGG_WRAP_BOX_V_EXPAND : 0));
g_free (text);
}
}
static void
populate_wrapbox_wrappy (EggWrapBox *wrapbox)
{
GtkWidget *widget, *frame;
gint i;
const gchar *strings[] = {
"These are", "some wrappy label", "texts", "of various", "lengths.",
"They should always be", "shown", "consecutively. Except it's",
"hard to say", "where exactly the", "label", "will wrap", "and where exactly",
"the actual", "container", "will wrap.", "This label is really really really long !",
"Let's add some more", "labels to the",
"mix. Just to", "make sure we", "got something to work", "with here."
};
for (i = 0; i < G_N_ELEMENTS (strings); i++)
{
widget = gtk_label_new (strings[i]);
frame = gtk_frame_new (NULL);
gtk_widget_show (widget);
gtk_widget_show (frame);
if (text_orientation == GTK_ORIENTATION_VERTICAL)
gtk_label_set_angle (GTK_LABEL (widget), 90);
gtk_container_add (GTK_CONTAINER (frame), widget);
gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL (widget), PANGO_WRAP_WORD);
gtk_label_set_width_chars (GTK_LABEL (widget), 10);
egg_wrap_box_insert_child (EGG_WRAP_BOX (wrapbox), frame, -1,
(items_xexpand ? EGG_WRAP_BOX_H_EXPAND : 0) |
(items_yexpand ? EGG_WRAP_BOX_V_EXPAND : 0));
}
}
static void
populate_wrapbox_stock (EggWrapBox *wrapbox)
{
GtkWidget *widget;
static GSList *stock_ids = NULL;
GSList *l;
gint i;
if (!stock_ids)
stock_ids = gtk_stock_list_ids ();
for (i = 0, l = stock_ids; i < 30 && l != NULL; i++, l = l->next)
{
gchar *stock_id = l->data;
widget = gtk_button_new_from_stock (stock_id);
gtk_widget_show (widget);
egg_wrap_box_insert_child (EGG_WRAP_BOX (wrapbox), widget, -1,
(items_xexpand ? EGG_WRAP_BOX_H_EXPAND : 0) |
(items_yexpand ? EGG_WRAP_BOX_V_EXPAND : 0));
}
}
static void
populate_items (EggWrapBox *wrapbox)
{
GList *children, *l;
/* Remove all children first */
children = gtk_container_get_children (GTK_CONTAINER (wrapbox));
for (l = children; l; l = l->next)
{
GtkWidget *child = l->data;
gtk_container_remove (GTK_CONTAINER (wrapbox), child);
}
g_list_free (children);
if (items_type == SIMPLE_ITEMS)
populate_wrapbox_simple (wrapbox);
else if (items_type == WRAPPY_ITEMS)
populate_wrapbox_wrappy (wrapbox);
else if (items_type == STOCK_ITEMS)
populate_wrapbox_stock (wrapbox);
}
static void
mode_changed (GtkComboBox *box,
EggWrapBox *wrapbox)
{
EggWrapAllocationMode mode = gtk_combo_box_get_active (box);
egg_wrap_box_set_allocation_mode (wrapbox, mode);
}
static void
horizontal_spreading_changed (GtkComboBox *box,
EggWrapBox *wrapbox)
{
EggWrapBoxSpreading spreading = gtk_combo_box_get_active (box);
egg_wrap_box_set_horizontal_spreading (wrapbox, spreading);
}
static void
vertical_spreading_changed (GtkComboBox *box,
EggWrapBox *wrapbox)
{
EggWrapBoxSpreading spreading = gtk_combo_box_get_active (box);
egg_wrap_box_set_vertical_spreading (wrapbox, spreading);
}
static void
orientation_changed (GtkComboBox *box,
EggWrapBox *wrapbox)
{
GtkOrientation orientation = gtk_combo_box_get_active (box);
gtk_orientable_set_orientation (GTK_ORIENTABLE (wrapbox), orientation);
}
static void
line_length_changed (GtkSpinButton *spin,
EggWrapBox *wrapbox)
{
gint length = gtk_spin_button_get_value_as_int (spin);
egg_wrap_box_set_minimum_line_children (wrapbox, length);
}
static void
spacing_changed (GtkSpinButton *button,
gpointer data)
{
GtkOrientation orientation = GPOINTER_TO_INT (data);
gint state = gtk_spin_button_get_value_as_int (button);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
egg_wrap_box_set_horizontal_spacing (the_wrapbox, state);
else
egg_wrap_box_set_vertical_spacing (the_wrapbox, state);
}
static void
items_changed (GtkComboBox *box,
EggWrapBox *wrapbox)
{
items_type = gtk_combo_box_get_active (box);
populate_items (wrapbox);
}
static void
text_orientation_changed (GtkComboBox *box,
EggWrapBox *wrapbox)
{
text_orientation = gtk_combo_box_get_active (box);
populate_items (wrapbox);
}
static void
child_option_toggled (GtkToggleButton *button,
gboolean *state)
{
*state = gtk_toggle_button_get_active (button);
populate_items (the_wrapbox);
}
static GtkWidget *
create_window (void)
{
GtkWidget *window, *hbox, *vbox, *frame, *wrapbox_cntl, *items_cntl;
GtkWidget *wrapbox, *widget, *expander, *swindow;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
hbox = gtk_hbox_new (FALSE, 2);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (window), 8);
gtk_widget_show (vbox);
gtk_widget_show (hbox);
gtk_container_add (GTK_CONTAINER (window), hbox);
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
frame = gtk_frame_new ("Wrap Box");
gtk_widget_show (frame);
gtk_box_pack_start (GTK_BOX (hbox), frame, TRUE, TRUE, 0);
swindow = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_widget_show (swindow);
gtk_container_add (GTK_CONTAINER (frame), swindow);
wrapbox = egg_wrap_box_new (INITIAL_ALLOCATION_MODE, INITIAL_SPREADING,
INITIAL_SPREADING, INITIAL_HSPACING, INITIAL_VSPACING);
the_wrapbox = (EggWrapBox *)wrapbox;
egg_wrap_box_set_minimum_line_children (EGG_WRAP_BOX (wrapbox), INITIAL_MINIMUM_LENGTH);
gtk_widget_show (wrapbox);
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (swindow), wrapbox);
/* Add Wrapbox test control frame */
expander = gtk_expander_new ("Wrap Box controls");
gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);
wrapbox_cntl = gtk_vbox_new (FALSE, 2);
gtk_widget_show (wrapbox_cntl);
gtk_widget_show (expander);
gtk_container_add (GTK_CONTAINER (expander), wrapbox_cntl);
gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 0);
/* Add Allocation mode control */
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Wrap Freely");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Align items");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Homogeneous");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), INITIAL_ALLOCATION_MODE);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the wrapbox allocation mode");
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (mode_changed), wrapbox);
/* Add Spreading controls */
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread Start");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread End");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread Even");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread Expand");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), INITIAL_SPREADING);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the horizontal spreading mode");
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (horizontal_spreading_changed), wrapbox);
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread Start");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread End");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread Even");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Spread Expand");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), INITIAL_SPREADING);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the vertical spreading mode");
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (vertical_spreading_changed), wrapbox);
/* Add Orientation control */
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Horizontal");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the wrapbox orientation");
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (orientation_changed), wrapbox);
/* Add minimum line length in items control */
widget = gtk_spin_button_new_with_range (1, 10, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_MINIMUM_LENGTH);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the minimum amount of items per line before wrapping");
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (line_length_changed), wrapbox);
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (line_length_changed), wrapbox);
/* Add horizontal/vertical spacing controls */
hbox = gtk_hbox_new (FALSE, 2);
gtk_widget_show (hbox);
widget = gtk_label_new ("H Spacing");
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
widget = gtk_spin_button_new_with_range (0, 30, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_HSPACING);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the horizontal spacing between children");
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_HORIZONTAL));
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_HORIZONTAL));
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), hbox, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 2);
gtk_widget_show (hbox);
widget = gtk_label_new ("V Spacing");
gtk_widget_show (widget);
gtk_box_pack_start (GTK_BOX (hbox), widget, TRUE, TRUE, 0);
widget = gtk_spin_button_new_with_range (0, 30, 1);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (widget), INITIAL_VSPACING);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the vertical spacing between children");
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_VERTICAL));
g_signal_connect (G_OBJECT (widget), "value-changed",
G_CALLBACK (spacing_changed), GINT_TO_POINTER (GTK_ORIENTATION_VERTICAL));
gtk_box_pack_start (GTK_BOX (wrapbox_cntl), hbox, FALSE, FALSE, 0);
/* Add test items control frame */
expander = gtk_expander_new ("Test item controls");
gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);
items_cntl = gtk_vbox_new (FALSE, 2);
gtk_widget_show (items_cntl);
gtk_widget_show (expander);
gtk_container_add (GTK_CONTAINER (expander), items_cntl);
gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 0);
/* Add Items control */
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Simple");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Wrappy");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Stock");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the item set to use");
gtk_box_pack_start (GTK_BOX (items_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (items_changed), wrapbox);
/* Add Text Orientation control */
widget = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Horizontal");
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), "Vertical");
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
gtk_widget_show (widget);
gtk_widget_set_tooltip_text (widget, "Set the item's text orientation (cant be done for stock buttons)");
gtk_box_pack_start (GTK_BOX (items_cntl), widget, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (widget), "changed",
G_CALLBACK (text_orientation_changed), wrapbox);
/* Add expand options */
hbox = gtk_hbox_new (FALSE, 2);
gtk_widget_show (hbox);
widget = gtk_check_button_new_with_label ("X Expand");