Commit 6ee1ae13 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Add properties, based on patch by Lee Mallabone.

2001-05-17  Alexander Larsson  <alla@lysator.liu.se>

	* gtk/gtkbbox.c:
	Add properties, based on patch by Lee Mallabone.

	* gtk/gtknotebook.c:
	* gtk/gtktoolbar.c:
	Convert from GtkArg to GParam, based on patch by John Margaglione.

	* gtk/gtkhscale.c:
	* gtk/gtkvscale.c:
	* gtk/gtkhscrollbar.c:
	* gtk/gtkvscrollbar.c:
	* gtk/gtkrange.c:
	Move adjustment property to GtkRange.

	* gtk/gtklabel.c:
	Setup mnemonics on property changes

	* gtk/gtkwidget.c (gtk_widget_get_property):
	GdkExtensionMode is an enum, not a flag. Set it with
	g_value_set_enum ().

	* tests/prop-editor.c:
	Better propery editor.

	* tests/testgtk.c:
	Add new property test. Pass zero to the property editor to
	get properties from all derived types.
parent be277ae4
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
2001-05-17 Alexander Larsson <alla@lysator.liu.se>
* gtk/gtkbbox.c:
Add properties, based on patch by Lee Mallabone.
* gtk/gtknotebook.c:
* gtk/gtktoolbar.c:
Convert from GtkArg to GParam, based on patch by John Margaglione.
* gtk/gtkhscale.c:
* gtk/gtkvscale.c:
* gtk/gtkhscrollbar.c:
* gtk/gtkvscrollbar.c:
* gtk/gtkrange.c:
Move adjustment property to GtkRange.
* gtk/gtklabel.c:
Setup mnemonics on property changes
* gtk/gtkwidget.c (gtk_widget_get_property):
GdkExtensionMode is an enum, not a flag. Set it with
g_value_set_enum ().
* tests/prop-editor.c:
Better propery editor.
* tests/testgtk.c:
Add new property test. Pass zero to the property editor to
get properties from all derived types.
Sun May 13 12:01:12 2001 Owen Taylor <otaylor@redhat.com>
* autogen.sh (have_automake): Require libtool-1.4,
......
......@@ -27,9 +27,22 @@
#include "gtkbbox.h"
#include "gtkintl.h"
enum {
PROP_0,
PROP_LAYOUT_STYLE,
PROP_LAST
};
static void gtk_button_box_class_init (GtkButtonBoxClass *klass);
static void gtk_button_box_init (GtkButtonBox *box);
static void gtk_button_box_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_button_box_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
#define DEFAULT_CHILD_MIN_WIDTH 85
#define DEFAULT_CHILD_MIN_HEIGHT 27
......@@ -65,9 +78,14 @@ static void
gtk_button_box_class_init (GtkButtonBoxClass *class)
{
GtkWidgetClass *widget_class;
GObjectClass *gobject_class;
gobject_class = G_OBJECT_CLASS (class);
widget_class = (GtkWidgetClass*) class;
gobject_class->set_property = gtk_button_box_set_property;
gobject_class->get_property = gtk_button_box_get_property;
/* FIXME we need to override the "spacing" property on GtkBox once
* libgobject allows that.
*/
......@@ -107,6 +125,14 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
G_MAXINT,
DEFAULT_CHILD_IPAD_Y,
G_PARAM_READABLE));
g_object_class_install_property (gobject_class,
PROP_LAYOUT_STYLE,
g_param_spec_enum ("layout_style",
_("Layout style"),
_("How to layout the buttons in the box. Possible values are default, spread, edge, start and end"),
GTK_TYPE_BUTTON_BOX_STYLE,
GTK_BUTTONBOX_DEFAULT_STYLE,
G_PARAM_READWRITE));
}
static void
......@@ -120,6 +146,43 @@ gtk_button_box_init (GtkButtonBox *button_box)
button_box->layout_style = GTK_BUTTONBOX_DEFAULT_STYLE;
}
static void
gtk_button_box_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_LAYOUT_STYLE:
gtk_button_box_set_layout (GTK_BUTTON_BOX (object),
g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_button_box_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_LAYOUT_STYLE:
g_value_set_enum (value, GTK_BUTTON_BOX (object)->layout_style);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
/* set per widget values for spacing, child size and child internal padding */
void gtk_button_box_set_child_size (GtkButtonBox *widget, gint width, gint height)
......@@ -141,7 +204,12 @@ void gtk_button_box_set_layout (GtkButtonBox *widget,
g_return_if_fail (layout_style >= GTK_BUTTONBOX_DEFAULT_STYLE &&
layout_style <= GTK_BUTTONBOX_END);
widget->layout_style = layout_style;
if (widget->layout_style != layout_style)
{
widget->layout_style = layout_style;
g_object_notify (G_OBJECT (widget), "layout_style");
gtk_widget_queue_resize (GTK_WIDGET (widget));
}
}
......
......@@ -35,8 +35,7 @@
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
enum {
PROP_0,
PROP_ADJUSTMENT
PROP_0
};
static void gtk_hscale_class_init (GtkHScaleClass *klass);
......@@ -132,13 +131,6 @@ gtk_hscale_class_init (GtkHScaleClass *class)
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));
binding_set = gtk_binding_set_by_class (object_class);
add_slider_binding (binding_set, GDK_Left, 0,
......@@ -192,9 +184,6 @@ gtk_hscale_set_property (GObject *object,
switch (prop_id)
{
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;
......@@ -213,10 +202,6 @@ gtk_hscale_get_property (GObject *object,
switch (prop_id)
{
case PROP_ADJUSTMENT:
g_value_set_object (value,
G_OBJECT (gtk_range_get_adjustment (GTK_RANGE (hscale))));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -35,8 +35,7 @@
#define RANGE_CLASS(w) GTK_RANGE_GET_CLASS (w)
enum {
PROP_0,
PROP_ADJUSTMENT
PROP_0
};
static void gtk_hscrollbar_class_init (GtkHScrollbarClass *klass);
......@@ -109,15 +108,6 @@ gtk_hscrollbar_class_init (GtkHScrollbarClass *class)
range_class->slider_update = gtk_hscrollbar_slider_update;
range_class->trough_click = _gtk_range_default_htrough_click;
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
......@@ -132,10 +122,6 @@ gtk_hscrollbar_set_property (GObject *object,
switch (prop_id)
{
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;
......@@ -154,9 +140,6 @@ gtk_hscrollbar_get_property (GObject *object,
switch (prop_id)
{
case PROP_ADJUSTMENT:
g_value_set_object (value, G_OBJECT (hscrollbar));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......
......@@ -125,6 +125,8 @@ static void gtk_label_select_region_index (GtkLabel *label,
static gboolean gtk_label_mnemonic_activate (GtkWidget *widget,
gboolean group_cycling);
static void gtk_label_setup_mnemonic (GtkLabel *label,
guint last_key);
static GtkMiscClass *parent_class = NULL;
......@@ -272,8 +274,10 @@ gtk_label_set_property (GObject *object,
GParamSpec *pspec)
{
GtkLabel *label;
guint last_keyval;
label = GTK_LABEL (object);
last_keyval = label->mnemonic_keyval;
switch (prop_id)
{
......@@ -281,6 +285,8 @@ gtk_label_set_property (GObject *object,
gtk_label_set_label_internal (label,
g_strdup (g_value_get_string (value)));
gtk_label_recalculate (label);
if (last_keyval != label->mnemonic_keyval)
gtk_label_setup_mnemonic (label, last_keyval);
break;
case PROP_ATTRIBUTES:
gtk_label_set_attributes (label, g_value_get_boxed (value));
......@@ -292,6 +298,8 @@ gtk_label_set_property (GObject *object,
case PROP_USE_UNDERLINE:
gtk_label_set_use_underline_internal (label, g_value_get_boolean (value));
gtk_label_recalculate (label);
if (label->use_underline)
gtk_label_setup_mnemonic (label, last_keyval);
break;
case PROP_JUSTIFY:
gtk_label_set_justify (label, g_value_get_enum (value));
......
......@@ -58,17 +58,17 @@ enum {
};
enum {
ARG_0,
ARG_TAB_POS,
ARG_SHOW_TABS,
ARG_SHOW_BORDER,
ARG_SCROLLABLE,
ARG_TAB_BORDER,
ARG_TAB_HBORDER,
ARG_TAB_VBORDER,
ARG_PAGE,
ARG_ENABLE_POPUP,
ARG_HOMOGENEOUS
PROP_0,
PROP_TAB_POS,
PROP_SHOW_TABS,
PROP_SHOW_BORDER,
PROP_SCROLLABLE,
PROP_TAB_BORDER,
PROP_TAB_HBORDER,
PROP_TAB_VBORDER,
PROP_PAGE,
PROP_ENABLE_POPUP,
PROP_HOMOGENEOUS
};
enum {
......@@ -121,12 +121,14 @@ static void gtk_notebook_focus_tab (GtkNotebook *notebook,
/*** GtkObject Methods ***/
static void gtk_notebook_destroy (GtkObject *object);
static void gtk_notebook_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_notebook_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_notebook_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
static void gtk_notebook_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
/*** GtkWidget Methods ***/
static void gtk_notebook_map (GtkWidget *widget);
......@@ -277,19 +279,21 @@ gtk_notebook_get_type (void)
static void
gtk_notebook_class_init (GtkNotebookClass *class)
{
GObjectClass *gobject_class;
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
GtkContainerClass *container_class;
GtkBindingSet *binding_set;
gobject_class = G_OBJECT_CLASS (class);
object_class = (GtkObjectClass*) class;
widget_class = (GtkWidgetClass*) class;
container_class = (GtkContainerClass*) class;
parent_class = gtk_type_class (gtk_container_get_type ());
object_class->set_arg = gtk_notebook_set_arg;
object_class->get_arg = gtk_notebook_get_arg;
gobject_class->set_property = gtk_notebook_set_property;
gobject_class->get_property = gtk_notebook_get_property;
object_class->destroy = gtk_notebook_destroy;
widget_class->map = gtk_notebook_map;
......@@ -321,16 +325,94 @@ gtk_notebook_class_init (GtkNotebookClass *class)
class->focus_tab = gtk_notebook_focus_tab;
class->select_page = gtk_notebook_select_page;
gtk_object_add_arg_type ("GtkNotebook::page", GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_PAGE);
gtk_object_add_arg_type ("GtkNotebook::tab_pos", GTK_TYPE_POSITION_TYPE, GTK_ARG_READWRITE, ARG_TAB_POS);
gtk_object_add_arg_type ("GtkNotebook::tab_border", GTK_TYPE_UINT, GTK_ARG_WRITABLE, ARG_TAB_BORDER);
gtk_object_add_arg_type ("GtkNotebook::tab_hborder", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_TAB_HBORDER);
gtk_object_add_arg_type ("GtkNotebook::tab_vborder", GTK_TYPE_UINT, GTK_ARG_READWRITE, ARG_TAB_VBORDER);
gtk_object_add_arg_type ("GtkNotebook::show_tabs", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SHOW_TABS);
gtk_object_add_arg_type ("GtkNotebook::show_border", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SHOW_BORDER);
gtk_object_add_arg_type ("GtkNotebook::scrollable", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SCROLLABLE);
gtk_object_add_arg_type ("GtkNotebook::enable_popup", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ENABLE_POPUP);
gtk_object_add_arg_type ("GtkNotebook::homogeneous", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_HOMOGENEOUS);
g_object_class_install_property (gobject_class,
PROP_PAGE,
g_param_spec_int ("page",
_("Page"),
_("The index of the current page"),
0,
G_MAXINT,
0,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TAB_POS,
g_param_spec_enum ("tab_pos",
_("Tab Position"),
_("Which side of the notebook holds the tabs"),
GTK_TYPE_POSITION_TYPE,
GTK_POS_TOP,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TAB_BORDER,
g_param_spec_uint ("tab_border",
_("Tab Border"),
_("Width of the border around the tab labels"),
0,
G_MAXUINT,
2,
G_PARAM_WRITABLE));
g_object_class_install_property (gobject_class,
PROP_TAB_HBORDER,
g_param_spec_uint ("tab_hborder",
_("Horizontal Tab Border"),
_("Width of the horizontal border of tab labels"),
0,
G_MAXUINT,
2,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_TAB_VBORDER,
g_param_spec_uint ("tab_vborder",
_("Vertical Tab Border"),
_("Width of the vertical border of tab labels"),
0,
G_MAXUINT,
2,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SHOW_TABS,
g_param_spec_boolean ("show_tabs",
_("Show Tabs"),
_("Whether tabs should be shown or not"),
TRUE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SHOW_BORDER,
g_param_spec_boolean ("show_border",
_("Show Border"),
_("Whether the border should be shown or not"),
TRUE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_SCROLLABLE,
g_param_spec_boolean ("scrollable",
_("Scrollable"),
_("If TRUE, scroll arrows are added if there are to many tabs to fit"),
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ENABLE_POPUP,
g_param_spec_boolean ("enable_popup",
_("Enable Popup"),
_("If TRUE, pressing the right mouse button on the notebook pops up a menu that you can use to go to a page"),
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_HOMOGENEOUS,
g_param_spec_boolean ("homogeneous",
_("Homogeneous"),
_("Whether tabs should have homogeneous sizes"),
FALSE,
G_PARAM_READWRITE));
gtk_container_add_child_arg_type ("GtkNotebook::tab_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_TAB_LABEL);
gtk_container_add_child_arg_type ("GtkNotebook::menu_label", GTK_TYPE_STRING, GTK_ARG_READWRITE, CHILD_ARG_MENU_LABEL);
......@@ -495,48 +577,49 @@ gtk_notebook_destroy (GtkObject *object)
}
static void
gtk_notebook_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
gtk_notebook_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
GtkNotebook *notebook;
notebook = GTK_NOTEBOOK (object);
switch (arg_id)
switch (prop_id)
{
case ARG_SHOW_TABS:
gtk_notebook_set_show_tabs (notebook, GTK_VALUE_BOOL (*arg));
case PROP_SHOW_TABS:
gtk_notebook_set_show_tabs (notebook, g_value_get_boolean (value));
break;
case ARG_SHOW_BORDER:
gtk_notebook_set_show_border (notebook, GTK_VALUE_BOOL (*arg));
case PROP_SHOW_BORDER:
gtk_notebook_set_show_border (notebook, g_value_get_boolean (value));
break;
case ARG_SCROLLABLE:
gtk_notebook_set_scrollable (notebook, GTK_VALUE_BOOL (*arg));
case PROP_SCROLLABLE:
gtk_notebook_set_scrollable (notebook, g_value_get_boolean (value));
break;
case ARG_ENABLE_POPUP:
if (GTK_VALUE_BOOL (*arg))
case PROP_ENABLE_POPUP:
if (g_value_get_boolean (value))
gtk_notebook_popup_enable (notebook);
else
gtk_notebook_popup_disable (notebook);
break;
case ARG_HOMOGENEOUS:
gtk_notebook_set_homogeneous_tabs (notebook, GTK_VALUE_BOOL (*arg));
case PROP_HOMOGENEOUS:
gtk_notebook_set_homogeneous_tabs (notebook, g_value_get_boolean (value));
break;
case ARG_PAGE:
gtk_notebook_set_page (notebook, GTK_VALUE_INT (*arg));
case PROP_PAGE:
gtk_notebook_set_page (notebook, g_value_get_int (value));
break;
case ARG_TAB_POS:
gtk_notebook_set_tab_pos (notebook, GTK_VALUE_ENUM (*arg));
case PROP_TAB_POS:
gtk_notebook_set_tab_pos (notebook, g_value_get_enum (value));
break;
case ARG_TAB_BORDER:
gtk_notebook_set_tab_border (notebook, GTK_VALUE_UINT (*arg));
case PROP_TAB_BORDER:
gtk_notebook_set_tab_border (notebook, g_value_get_uint (value));
break;
case ARG_TAB_HBORDER:
gtk_notebook_set_tab_hborder (notebook, GTK_VALUE_UINT (*arg));
case PROP_TAB_HBORDER:
gtk_notebook_set_tab_hborder (notebook, g_value_get_uint (value));
break;
case ARG_TAB_VBORDER:
gtk_notebook_set_tab_vborder (notebook, GTK_VALUE_UINT (*arg));
case PROP_TAB_VBORDER:
gtk_notebook_set_tab_vborder (notebook, g_value_get_uint (value));
break;
default:
break;
......@@ -544,45 +627,46 @@ gtk_notebook_set_arg (GtkObject *object,
}
static void
gtk_notebook_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id)
gtk_notebook_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
GtkNotebook *notebook;
notebook = GTK_NOTEBOOK (object);
switch (arg_id)
switch (prop_id)
{
case ARG_SHOW_TABS:
GTK_VALUE_BOOL (*arg) = notebook->show_tabs;
case PROP_SHOW_TABS:
g_value_set_boolean (value, notebook->show_tabs);
break;
case ARG_SHOW_BORDER:
GTK_VALUE_BOOL (*arg) = notebook->show_border;
case PROP_SHOW_BORDER:
g_value_set_boolean (value, notebook->show_border);
break;
case ARG_SCROLLABLE:
GTK_VALUE_BOOL (*arg) = notebook->scrollable;
case PROP_SCROLLABLE:
g_value_set_boolean (value, notebook->scrollable);