Commit aa209a95 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Remove leaks.

2001-03-30  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkbutton.c (gtk_button_get_property):
	* gtk/gtklabel.c:
	Remove leaks.

	* gtk/gtkcontainer.c:
	* gtk/gtkhscale.c:
	* gtk/gtkhscrollbar.c:
	* gtk/gtklayout.c:
	* gtk/gtkmisc.c:
	* gtk/gtkprogress.c:
	* gtk/gtkprogressbar.c:
	* gtk/gtkrange.c:
	* gtk/gtktable.c:
	* gtk/gtkviewport.c:
	* gtk/gtkvscale.c:
	* gtk/gtkvscrollbar.c:
	* gtk/gtkwidget.c:
	Property patches, based on patches from John Margaglione and Lee Mallabone.
parent c80b7054
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
2001-03-30 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.c (gtk_button_get_property):
* gtk/gtklabel.c:
Remove leaks.
* gtk/gtkcontainer.c:
* gtk/gtkhscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtklayout.c:
* gtk/gtkmisc.c:
* gtk/gtkprogress.c:
* gtk/gtkprogressbar.c:
* gtk/gtkrange.c:
* gtk/gtktable.c:
* gtk/gtkviewport.c:
* gtk/gtkvscale.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkwidget.c:
Property patches, based on patches from John Margaglione and Lee Mallabone.
Thu Mar 29 21:20:38 2001 Mike Kestner <mkestner@ameritech.net>
* gtk/gtkspinbutton.c : added value_changed signal which proxies for the
......
......@@ -306,12 +306,12 @@ gtk_button_get_property (GObject *object,
{
case PROP_LABEL:
if (GTK_BIN (button)->child && GTK_IS_LABEL (GTK_BIN (button)->child))
g_value_set_string(value, g_strdup (GTK_LABEL (GTK_BIN (button)->child)->label));
g_value_set_string (value, GTK_LABEL (GTK_BIN (button)->child)->label);
else
g_value_set_string(value, NULL);
g_value_set_string (value, NULL);
break;
case PROP_RELIEF:
g_value_set_enum(value, gtk_button_get_relief (button));
g_value_set_enum (value, gtk_button_get_relief (button));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......
......@@ -33,6 +33,7 @@
#include "gtksignal.h"
#include "gtkmain.h"
#include "gtkwindow.h"
#include "gtkintl.h"
enum {
ADD,
......@@ -44,11 +45,11 @@ enum {
};
enum {
ARG_0,
ARG_BORDER_WIDTH,
ARG_RESIZE_MODE,
ARG_CHILD,
ARG_REALLOCATE_REDRAWS
PROP_0,
PROP_BORDER_WIDTH,
PROP_RESIZE_MODE,
PROP_CHILD,
PROP_REALLOCATE_REDRAWS
};
typedef struct _GtkChildArgInfo GtkChildArgInfo;
......@@ -66,12 +67,14 @@ static void gtk_container_base_class_init (GtkContainerClass *klass);
static void gtk_container_class_init (GtkContainerClass *klass);
static void gtk_container_init (GtkContainer *container);
static void gtk_container_destroy (GtkObject *object);
static void gtk_container_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_container_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_container_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_container_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_container_add_unimplemented (GtkContainer *container,
GtkWidget *widget);
static void gtk_container_remove_unimplemented (GtkContainer *container,
......@@ -154,9 +157,11 @@ gtk_container_base_class_init (GtkContainerClass *class)
static void
gtk_container_class_init (GtkContainerClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
gobject_class = G_OBJECT_CLASS (class);
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
......@@ -168,9 +173,40 @@ gtk_container_class_init (GtkContainerClass *class)
vadjustment_key_id = g_quark_from_static_string (vadjustment_key);
hadjustment_key_id = g_quark_from_static_string (hadjustment_key);
object_class->get_arg = gtk_container_get_arg;
object_class->set_arg = gtk_container_set_arg;
gobject_class->set_property = gtk_container_set_property;
gobject_class->get_property = gtk_container_get_property;
g_object_class_install_property (gobject_class,
PROP_RESIZE_MODE,
g_param_spec_enum ("resize_mode",
_("Resize mode"),
_("Specify how resize events are handled"),
GTK_TYPE_RESIZE_MODE,
GTK_RESIZE_PARENT,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_BORDER_WIDTH,
g_param_spec_uint ("border_width",
_("Border width"),
_("The width of the empty border outside the containers children."),
0,
G_MAXINT,
0,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_CHILD,
g_param_spec_object ("child",
_("Child"),
_("Can be used to add a new child to the container."),
GTK_TYPE_WIDGET,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class,
PROP_REALLOCATE_REDRAWS,
g_param_spec_boolean ("reallocate_redraws",
_("Reallocate redraws"),
_("Whether redraws should be reallocated"),
FALSE,
G_PARAM_READWRITE));
object_class->destroy = gtk_container_destroy;
widget_class->show_all = gtk_container_show_all;
......@@ -186,11 +222,6 @@ gtk_container_class_init (GtkContainerClass *class)
class->child_type = NULL;
class->composite_name = gtk_container_child_default_composite_name;
gtk_object_add_arg_type ("GtkContainer::border_width", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_BORDER_WIDTH);
gtk_object_add_arg_type ("GtkContainer::resize_mode", GTK_TYPE_RESIZE_MODE, GTK_ARG_READWRITE, ARG_RESIZE_MODE);
gtk_object_add_arg_type ("GtkContainer::child", GTK_TYPE_WIDGET, GTK_ARG_WRITABLE, ARG_CHILD);
gtk_object_add_arg_type ("GtkContainer::reallocate_redraws", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_REALLOCATE_REDRAWS);
container_signals[ADD] =
gtk_signal_new ("add",
GTK_RUN_FIRST,
......@@ -641,55 +672,59 @@ gtk_container_destroy (GtkObject *object)
}
static void
gtk_container_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
gtk_container_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkContainer *container;
container = GTK_CONTAINER (object);
switch (arg_id)
switch (prop_id)
{
case ARG_BORDER_WIDTH:
gtk_container_set_border_width (container, GTK_VALUE_UINT (*arg));
case PROP_BORDER_WIDTH:
gtk_container_set_border_width (container, g_value_get_uint (value));
break;
case ARG_RESIZE_MODE:
gtk_container_set_resize_mode (container, GTK_VALUE_ENUM (*arg));
case PROP_RESIZE_MODE:
gtk_container_set_resize_mode (container, g_value_get_enum (value));
break;
case ARG_REALLOCATE_REDRAWS:
gtk_container_set_reallocate_redraws (container, GTK_VALUE_BOOL (*arg));
case PROP_REALLOCATE_REDRAWS:
gtk_container_set_reallocate_redraws (container,
g_value_get_boolean (value));
break;
case ARG_CHILD:
gtk_container_add (container, GTK_WIDGET (GTK_VALUE_OBJECT (*arg)));
case PROP_CHILD:
gtk_container_add (container, GTK_WIDGET (g_value_get_object (value)));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_container_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
gtk_container_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkContainer *container;
container = GTK_CONTAINER (object);
switch (arg_id)
switch (prop_id)
{
case ARG_BORDER_WIDTH:
GTK_VALUE_UINT (*arg) = container->border_width;
case PROP_BORDER_WIDTH:
g_value_set_uint (value, container->border_width);
break;
case ARG_RESIZE_MODE:
GTK_VALUE_ENUM (*arg) = container->resize_mode;
case PROP_RESIZE_MODE:
g_value_set_enum (value, container->resize_mode);
break;
case ARG_REALLOCATE_REDRAWS:
GTK_VALUE_BOOL (*arg) = container->reallocate_redraws;
case PROP_REALLOCATE_REDRAWS:
g_value_set_boolean (value, container->reallocate_redraws);
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
......@@ -718,7 +753,8 @@ gtk_container_set_border_width (GtkContainer *container,
if (container->border_width != border_width)
{
container->border_width = border_width;
g_object_notify (G_OBJECT (container), "border_width");
if (GTK_WIDGET_REALIZED (container))
gtk_widget_queue_resize (GTK_WIDGET (container));
}
......@@ -827,7 +863,10 @@ gtk_container_set_resize_mode (GtkContainer *container,
if (GTK_WIDGET_TOPLEVEL (container) &&
resize_mode == GTK_RESIZE_PARENT)
resize_mode = GTK_RESIZE_QUEUE;
{
resize_mode = GTK_RESIZE_QUEUE;
g_object_notify (G_OBJECT (container), "resize_mode");
}
if (container->resize_mode != resize_mode)
{
......@@ -840,6 +879,7 @@ gtk_container_set_resize_mode (GtkContainer *container,
gtk_container_clear_resize_widgets (container);
gtk_widget_queue_resize (GTK_WIDGET (container));
}
g_object_notify (G_OBJECT (container), "resize_mode");
}
}
......@@ -853,6 +893,8 @@ gtk_container_set_reallocate_redraws (GtkContainer *container,
if (needs_redraws != container->reallocate_redraws)
{
container->reallocate_redraws = needs_redraws;
g_object_notify (G_OBJECT (container), "reallocate_redraws");
if (container->reallocate_redraws)
gtk_widget_queue_draw (GTK_WIDGET (container));
}
......
......@@ -28,23 +28,26 @@
#include "gtkhscale.h"
#include "gtksignal.h"
#include "gdk/gdkkeysyms.h"
#include "gtkintl.h"
#define SCALE_CLASS(w) GTK_SCALE_GET_CLASS (w)
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
enum {
ARG_0,
ARG_ADJUSTMENT
PROP_0,
PROP_ADJUSTMENT
};
static void gtk_hscale_class_init (GtkHScaleClass *klass);
static void gtk_hscale_init (GtkHScale *hscale);
static void gtk_hscale_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_hscale_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_hscale_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_hscale_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_hscale_realize (GtkWidget *widget);
static void gtk_hscale_size_request (GtkWidget *widget,
GtkRequisition *requisition);
......@@ -97,24 +100,21 @@ gtk_hscale_get_type (void)
static void
gtk_hscale_class_init (GtkHScaleClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkRangeClass *range_class;
GtkScaleClass *scale_class;
gobject_class = (GObjectClass*) class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
range_class = (GtkRangeClass*) class;
scale_class = (GtkScaleClass*) class;
gtk_object_add_arg_type ("GtkHScale::adjustment",
GTK_TYPE_ADJUSTMENT,
GTK_ARG_READWRITE,
ARG_ADJUSTMENT);
object_class->set_arg = gtk_hscale_set_arg;
object_class->get_arg = gtk_hscale_get_arg;
gobject_class->set_property = gtk_hscale_set_property;
gobject_class->get_property = gtk_hscale_get_property;
widget_class->realize = gtk_hscale_realize;
widget_class->size_request = gtk_hscale_size_request;
widget_class->size_allocate = gtk_hscale_size_allocate;
......@@ -127,43 +127,56 @@ gtk_hscale_class_init (GtkHScaleClass *class)
range_class->clear_background = gtk_hscale_clear_background;
scale_class->draw_value = gtk_hscale_draw_value;
g_object_class_install_property (gobject_class,
PROP_ADJUSTMENT,
g_param_spec_object ("adjustment",
_("Adjustment"),
_("The GtkAdjustment that determines the values to use for this HScale."),
GTK_TYPE_ADJUSTMENT,
G_PARAM_READWRITE));
}
static void
gtk_hscale_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
static void
gtk_hscale_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkHScale *hscale;
hscale = GTK_HSCALE (object);
switch (arg_id)
switch (prop_id)
{
case ARG_ADJUSTMENT:
gtk_range_set_adjustment (GTK_RANGE (hscale), GTK_VALUE_POINTER (*arg));
case PROP_ADJUSTMENT:
gtk_range_set_adjustment (GTK_RANGE (hscale), g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_hscale_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
static void
gtk_hscale_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkHScale *hscale;
hscale = GTK_HSCALE (object);
switch (arg_id)
switch (prop_id)
{
case ARG_ADJUSTMENT:
GTK_VALUE_POINTER (*arg) = GTK_RANGE (hscale);
case PROP_ADJUSTMENT:
g_value_set_object (value,
G_OBJECT (gtk_range_get_adjustment (GTK_RANGE (hscale))));
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
......
......@@ -27,6 +27,7 @@
#include "gtkhscrollbar.h"
#include "gtksignal.h"
#include "gdk/gdkkeysyms.h"
#include "gtkintl.h"
#define EPSILON 0.01
......@@ -34,18 +35,20 @@
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
enum {
ARG_0,
ARG_ADJUSTMENT
PROP_0,
PROP_ADJUSTMENT
};
static void gtk_hscrollbar_class_init (GtkHScrollbarClass *klass);
static void gtk_hscrollbar_init (GtkHScrollbar *hscrollbar);
static void gtk_hscrollbar_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_hscrollbar_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_hscrollbar_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_hscrollbar_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_hscrollbar_realize (GtkWidget *widget);
static void gtk_hscrollbar_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
......@@ -87,22 +90,19 @@ gtk_hscrollbar_get_type (void)
static void
gtk_hscrollbar_class_init (GtkHScrollbarClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkRangeClass *range_class;
gobject_class = (GObjectClass*) class;
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
range_class = (GtkRangeClass*) class;
gtk_object_add_arg_type ("GtkHScrollbar::adjustment",
GTK_TYPE_ADJUSTMENT,
GTK_ARG_READWRITE,
ARG_ADJUSTMENT);
object_class->set_arg = gtk_hscrollbar_set_arg;
object_class->get_arg = gtk_hscrollbar_get_arg;
gobject_class->set_property = gtk_hscrollbar_set_property;
gobject_class->get_property = gtk_hscrollbar_get_property;
widget_class->realize = gtk_hscrollbar_realize;
widget_class->size_allocate = gtk_hscrollbar_size_allocate;
......@@ -112,43 +112,56 @@ gtk_hscrollbar_class_init (GtkHScrollbarClass *class)
range_class->trough_click = _gtk_range_default_htrough_click;
range_class->trough_keys = gtk_hscrollbar_trough_keys;
range_class->motion = _gtk_range_default_hmotion;
g_object_class_install_property (gobject_class,
PROP_ADJUSTMENT,
g_param_spec_object ("adjustment",
_("Adjustment"),
_("The GtkAdjustment that determines the values to use for this scrollbar."),
GTK_TYPE_ADJUSTMENT,
G_PARAM_READWRITE));
}
static void
gtk_hscrollbar_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
static void
gtk_hscrollbar_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkHScrollbar *hscrollbar;
hscrollbar = GTK_HSCROLLBAR (object);
switch (arg_id)
switch (prop_id)
{
case ARG_ADJUSTMENT:
gtk_range_set_adjustment (GTK_RANGE (hscrollbar), GTK_VALUE_POINTER (*arg));
case PROP_ADJUSTMENT:
gtk_range_set_adjustment (GTK_RANGE (hscrollbar),
g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_hscrollbar_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
static void
gtk_hscrollbar_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkHScrollbar *hscrollbar;
hscrollbar = GTK_HSCROLLBAR (object);
switch (arg_id)
switch (prop_id)
{
case ARG_ADJUSTMENT:
GTK_VALUE_POINTER (*arg) = GTK_RANGE (hscrollbar);
case PROP_ADJUSTMENT:
g_value_set_object (value, G_OBJECT (hscrollbar));
break;
default:
arg->type = GTK_TYPE_INVALID;
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
......
......@@ -327,7 +327,7 @@ gtk_label_get_property (GObject *object,
switch (prop_id)
{
case PROP_LABEL:
g_value_set_string (value, g_strdup (label->label));
g_value_set_string (value, label->label);
break;
case PROP_ATTRIBUTES:
g_value_set_boxed (value, label->attrs);
......
......@@ -33,6 +33,7 @@
#include "gtklayout.h"
#include "gtksignal.h"
#include "gtkprivate.h"
#include "gtkintl.h"
typedef struct _GtkLayoutChild GtkLayoutChild;
......@@ -42,7 +43,23 @@ struct _GtkLayoutChild {
gint y;
};
enum {
PROP_0,
PROP_HADJUSTMENT,
PROP_VADJUSTMENT,
PROP_WIDTH,
PROP_HEIGHT
};
static void gtk_layout_class_init (GtkLayoutClass *class);
static void gtk_layout_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
static void gtk_layout_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_layout_init (GtkLayout *layout);
static void gtk_layout_finalize (GObject *object);
......@@ -186,6 +203,7 @@ gtk_layout_set_hadjustment (GtkLayout *layout,
g_return_if_fail (GTK_IS_LAYOUT (layout));
gtk_layout_set_adjustments (layout, adjustment, layout->vadjustment);
g_object_notify (G_OBJECT (layout), "hadjustment");
}