2005-01-29 20:26:14 +08:00
|
|
|
/* LIBGIMP - The GIMP Library
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
2002-03-17 22:07:54 +08:00
|
|
|
*
|
2004-04-18 23:12:42 +08:00
|
|
|
* gimpenumwidgets.c
|
|
|
|
* Copyright (C) 2002-2004 Sven Neumann <sven@gimp.org>
|
2002-03-17 22:07:54 +08:00
|
|
|
*
|
2005-01-29 09:08:20 +08:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
2002-03-17 22:07:54 +08:00
|
|
|
*
|
2005-01-29 09:08:20 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2002-03-17 22:07:54 +08:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2005-01-29 09:08:20 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2002-03-17 22:07:54 +08:00
|
|
|
*
|
2005-01-29 09:08:20 +08:00
|
|
|
* You should have received a copy of the GNU Lesser 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.
|
2002-03-17 22:07:54 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2004-07-29 20:33:15 +08:00
|
|
|
#include "libgimpbase/gimpbase.h"
|
2002-03-17 22:07:54 +08:00
|
|
|
|
2005-01-29 09:08:20 +08:00
|
|
|
#include "gimpwidgetstypes.h"
|
2005-01-29 20:26:14 +08:00
|
|
|
|
|
|
|
#include "gimpenumwidgets.h"
|
2005-01-29 09:08:20 +08:00
|
|
|
#include "gimpframe.h"
|
|
|
|
#include "gimphelpui.h"
|
2002-03-17 22:07:54 +08:00
|
|
|
|
|
|
|
|
2002-03-19 06:26:41 +08:00
|
|
|
/**
|
|
|
|
* gimp_enum_radio_box_new:
|
|
|
|
* @enum_type: the #GType of an enum.
|
|
|
|
* @callback: a callback to connect to the "toggled" signal of each
|
|
|
|
* #GtkRadioButton that is created.
|
2003-10-26 03:00:49 +08:00
|
|
|
* @callback_data: data to pass to the @callback.
|
2002-03-19 06:26:41 +08:00
|
|
|
* @first_button: returns the first button in the created group.
|
2003-10-26 03:00:49 +08:00
|
|
|
*
|
2005-01-22 09:50:15 +08:00
|
|
|
* Creates a new group of #GtkRadioButtons representing the enum
|
|
|
|
* values. A group of radiobuttons is a good way to represent enums
|
|
|
|
* with up to three or four values. Often it is better to use a
|
|
|
|
* #GimpEnumComboBox instead.
|
2003-10-26 03:00:49 +08:00
|
|
|
*
|
2002-03-19 06:26:41 +08:00
|
|
|
* Return value: a new #GtkVBox holding a group of #GtkRadioButtons.
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2002-03-19 06:26:41 +08:00
|
|
|
**/
|
|
|
|
GtkWidget *
|
|
|
|
gimp_enum_radio_box_new (GType enum_type,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data,
|
|
|
|
GtkWidget **first_button)
|
2002-05-14 01:15:17 +08:00
|
|
|
{
|
|
|
|
GEnumClass *enum_class;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
|
|
|
|
|
|
|
enum_class = g_type_class_ref (enum_type);
|
|
|
|
|
|
|
|
vbox = gimp_enum_radio_box_new_with_range (enum_type,
|
|
|
|
enum_class->minimum,
|
|
|
|
enum_class->maximum,
|
|
|
|
callback, callback_data,
|
|
|
|
first_button);
|
2003-10-26 03:00:49 +08:00
|
|
|
|
2002-05-14 01:15:17 +08:00
|
|
|
g_type_class_unref (enum_class);
|
|
|
|
|
|
|
|
return vbox;
|
|
|
|
}
|
|
|
|
|
2005-01-22 09:50:15 +08:00
|
|
|
/**
|
|
|
|
* gimp_enum_radio_box_new_with_range:
|
|
|
|
* @minimum:
|
|
|
|
* @maximum:
|
|
|
|
* @enum_type: the #GType of an enum.
|
|
|
|
* @callback: a callback to connect to the "toggled" signal of each
|
|
|
|
* #GtkRadioButton that is created.
|
|
|
|
* @callback_data: data to pass to the @callback.
|
|
|
|
* @first_button: returns the first button in the created group.
|
|
|
|
*
|
|
|
|
* Just like gimp_enum_radio_box_new(), this function creates a group
|
|
|
|
* of radio buttons, but it allows to limit the range of available
|
|
|
|
* enum values.
|
|
|
|
*
|
|
|
|
* Return value: a new #GtkVBox holding a group of #GtkRadioButtons.
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2005-01-22 09:50:15 +08:00
|
|
|
**/
|
2002-05-14 01:15:17 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_enum_radio_box_new_with_range (GType enum_type,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data,
|
|
|
|
GtkWidget **first_button)
|
2002-03-19 06:26:41 +08:00
|
|
|
{
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GEnumClass *enum_class;
|
|
|
|
GEnumValue *value;
|
|
|
|
GSList *group = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
|
|
|
|
|
|
|
enum_class = g_type_class_ref (enum_type);
|
|
|
|
|
|
|
|
vbox = gtk_vbox_new (FALSE, 1);
|
|
|
|
g_object_weak_ref (G_OBJECT (vbox),
|
|
|
|
(GWeakNotify) g_type_class_unref, enum_class);
|
|
|
|
|
2002-05-14 01:15:17 +08:00
|
|
|
if (first_button)
|
|
|
|
*first_button = NULL;
|
|
|
|
|
2002-03-19 06:26:41 +08:00
|
|
|
for (value = enum_class->values; value->value_name; value++)
|
|
|
|
{
|
2004-10-26 01:55:25 +08:00
|
|
|
const gchar *desc;
|
2004-07-29 20:33:15 +08:00
|
|
|
|
2002-05-14 01:15:17 +08:00
|
|
|
if (value->value < minimum || value->value > maximum)
|
|
|
|
continue;
|
|
|
|
|
2004-10-26 01:55:25 +08:00
|
|
|
desc = gimp_enum_value_get_desc (enum_class, value);
|
2004-07-29 20:33:15 +08:00
|
|
|
|
2004-10-26 01:55:25 +08:00
|
|
|
button = gtk_radio_button_new_with_mnemonic (group, desc);
|
2002-03-19 06:26:41 +08:00
|
|
|
|
2002-05-14 01:15:17 +08:00
|
|
|
if (first_button && *first_button == NULL)
|
2002-03-19 06:26:41 +08:00
|
|
|
*first_button = button;
|
|
|
|
|
|
|
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (button), "gimp-item-data",
|
|
|
|
GINT_TO_POINTER (value->value));
|
|
|
|
|
|
|
|
if (callback)
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_connect (button, "toggled",
|
2002-03-19 06:26:41 +08:00
|
|
|
callback,
|
|
|
|
callback_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return vbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_enum_radio_frame_new:
|
|
|
|
* @enum_type: the #GType of an enum.
|
2005-01-29 20:26:14 +08:00
|
|
|
* @label_widget: a widget to use as label for the frame that will
|
|
|
|
* hold the radio box.
|
2002-03-19 06:26:41 +08:00
|
|
|
* @callback: a callback to connect to the "toggled" signal of each
|
|
|
|
* #GtkRadioButton that is created.
|
|
|
|
* @callback_data: data to pass to the @callback.
|
|
|
|
* @first_button: returns the first button in the created group.
|
|
|
|
*
|
|
|
|
* Calls gimp_enum_radio_box_new() and puts the resulting vbox into a
|
|
|
|
* #GtkFrame.
|
2003-10-26 03:00:49 +08:00
|
|
|
*
|
2002-03-19 06:26:41 +08:00
|
|
|
* Return value: a new #GtkFrame holding a group of #GtkRadioButtons.
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2002-03-19 06:26:41 +08:00
|
|
|
**/
|
|
|
|
GtkWidget *
|
2005-01-29 20:26:14 +08:00
|
|
|
gimp_enum_radio_frame_new (GType enum_type,
|
|
|
|
GtkWidget *label_widget,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data,
|
|
|
|
GtkWidget **first_button)
|
2002-03-19 06:26:41 +08:00
|
|
|
{
|
2004-05-03 05:13:51 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *radio_box;
|
2002-03-19 06:26:41 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
|
|
|
g_return_val_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget),
|
|
|
|
NULL);
|
|
|
|
|
2004-05-03 05:13:51 +08:00
|
|
|
frame = gimp_frame_new (NULL);
|
2003-10-26 03:00:49 +08:00
|
|
|
|
2002-03-19 06:26:41 +08:00
|
|
|
if (label_widget)
|
|
|
|
{
|
|
|
|
gtk_frame_set_label_widget (GTK_FRAME (frame), label_widget);
|
|
|
|
gtk_widget_show (label_widget);
|
|
|
|
}
|
|
|
|
|
2003-10-26 03:00:49 +08:00
|
|
|
radio_box = gimp_enum_radio_box_new (enum_type,
|
2002-03-19 06:26:41 +08:00
|
|
|
callback, callback_data,
|
|
|
|
first_button);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), radio_box);
|
|
|
|
gtk_widget_show (radio_box);
|
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
2002-05-14 01:15:17 +08:00
|
|
|
|
2005-01-22 09:50:15 +08:00
|
|
|
/**
|
|
|
|
* gimp_enum_radio_frame_new_with_range:
|
|
|
|
* @enum_type: the #GType of an enum.
|
|
|
|
* @minimum:
|
|
|
|
* @maximum:
|
|
|
|
* @label_widget: a widget to put into the frame that will hold the radio box.
|
|
|
|
* @callback: a callback to connect to the "toggled" signal of each
|
|
|
|
* #GtkRadioButton that is created.
|
|
|
|
* @callback_data: data to pass to the @callback.
|
|
|
|
* @first_button: returns the first button in the created group.
|
|
|
|
*
|
|
|
|
* Calls gimp_enum_radio_box_new_with_range() and puts the resulting
|
|
|
|
* vbox into a #GtkFrame.
|
|
|
|
*
|
|
|
|
* Return value: a new #GtkFrame holding a group of #GtkRadioButtons.
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2005-01-22 09:50:15 +08:00
|
|
|
**/
|
2002-05-14 01:15:17 +08:00
|
|
|
GtkWidget *
|
2005-01-29 20:26:14 +08:00
|
|
|
gimp_enum_radio_frame_new_with_range (GType enum_type,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum,
|
|
|
|
GtkWidget *label_widget,
|
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data,
|
|
|
|
GtkWidget **first_button)
|
2002-05-14 01:15:17 +08:00
|
|
|
{
|
2004-05-03 05:13:51 +08:00
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *radio_box;
|
2002-05-14 01:15:17 +08:00
|
|
|
|
|
|
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
|
|
|
g_return_val_if_fail (label_widget == NULL || GTK_IS_WIDGET (label_widget),
|
|
|
|
NULL);
|
|
|
|
|
2004-05-03 05:13:51 +08:00
|
|
|
frame = gimp_frame_new (NULL);
|
2003-10-26 03:00:49 +08:00
|
|
|
|
2002-05-14 01:15:17 +08:00
|
|
|
if (label_widget)
|
|
|
|
{
|
|
|
|
gtk_frame_set_label_widget (GTK_FRAME (frame), label_widget);
|
|
|
|
gtk_widget_show (label_widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
radio_box = gimp_enum_radio_box_new_with_range (enum_type,
|
|
|
|
minimum,
|
|
|
|
maximum,
|
|
|
|
callback, callback_data,
|
|
|
|
first_button);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), radio_box);
|
|
|
|
gtk_widget_show (radio_box);
|
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|
2003-02-05 21:03:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gimp_enum_stock_box_new:
|
|
|
|
* @enum_type: the #GType of an enum.
|
|
|
|
* @stock_prefix: the prefix of the group of stock ids to use.
|
2003-08-09 03:30:23 +08:00
|
|
|
* @icon_size:
|
2003-02-05 21:03:44 +08:00
|
|
|
* @callback: a callback to connect to the "toggled" signal of each
|
|
|
|
* #GtkRadioButton that is created.
|
|
|
|
* @callback_data: data to pass to the @callback.
|
|
|
|
* @first_button: returns the first button in the created group.
|
|
|
|
*
|
|
|
|
* Creates a horizontal box of radio buttons with stock icons. The
|
|
|
|
* stock_id for each icon is created by appending the enum_value's
|
|
|
|
* nick to the given @stock_prefix.
|
2003-10-26 03:00:49 +08:00
|
|
|
*
|
2003-02-05 21:03:44 +08:00
|
|
|
* Return value: a new #GtkHbox holding a group of #GtkRadioButtons.
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2003-02-05 21:03:44 +08:00
|
|
|
**/
|
|
|
|
GtkWidget *
|
|
|
|
gimp_enum_stock_box_new (GType enum_type,
|
|
|
|
const gchar *stock_prefix,
|
2003-03-31 20:09:09 +08:00
|
|
|
GtkIconSize icon_size,
|
2003-02-05 21:03:44 +08:00
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data,
|
|
|
|
GtkWidget **first_button)
|
|
|
|
{
|
|
|
|
GEnumClass *enum_class;
|
|
|
|
GtkWidget *box;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
|
|
|
|
|
|
|
enum_class = g_type_class_ref (enum_type);
|
|
|
|
|
|
|
|
box = gimp_enum_stock_box_new_with_range (enum_type,
|
|
|
|
enum_class->minimum,
|
|
|
|
enum_class->maximum,
|
2003-03-31 20:09:09 +08:00
|
|
|
stock_prefix, icon_size,
|
2003-02-05 21:03:44 +08:00
|
|
|
callback, callback_data,
|
|
|
|
first_button);
|
2003-10-26 03:00:49 +08:00
|
|
|
|
2003-02-05 21:03:44 +08:00
|
|
|
g_type_class_unref (enum_class);
|
|
|
|
|
|
|
|
return box;
|
|
|
|
}
|
|
|
|
|
2005-01-22 09:50:15 +08:00
|
|
|
/**
|
|
|
|
* gimp_enum_stock_box_new_with_range:
|
|
|
|
* @enum_type: the #GType of an enum.
|
|
|
|
* @minimum:
|
|
|
|
* @maximum:
|
|
|
|
* @stock_prefix: the prefix of the group of stock ids to use.
|
|
|
|
* @icon_size:
|
|
|
|
* @callback: a callback to connect to the "toggled" signal of each
|
|
|
|
* #GtkRadioButton that is created.
|
|
|
|
* @callback_data: data to pass to the @callback.
|
|
|
|
* @first_button: returns the first button in the created group.
|
|
|
|
*
|
|
|
|
* Just like gimp_enum_stock_box_new(), this function creates a group
|
|
|
|
* of radio buttons, but it allows to limit the range of available
|
|
|
|
* enum values.
|
|
|
|
*
|
|
|
|
* Return value: a new #GtkHbox holding a group of #GtkRadioButtons.
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2005-01-22 09:50:15 +08:00
|
|
|
**/
|
2003-02-05 21:03:44 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_enum_stock_box_new_with_range (GType enum_type,
|
|
|
|
gint minimum,
|
|
|
|
gint maximum,
|
|
|
|
const gchar *stock_prefix,
|
2003-03-31 20:09:09 +08:00
|
|
|
GtkIconSize icon_size,
|
2003-02-05 21:03:44 +08:00
|
|
|
GCallback callback,
|
|
|
|
gpointer callback_data,
|
|
|
|
GtkWidget **first_button)
|
|
|
|
{
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *image;
|
|
|
|
GEnumClass *enum_class;
|
|
|
|
GEnumValue *value;
|
|
|
|
gchar *stock_id;
|
|
|
|
GSList *group = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_TYPE_IS_ENUM (enum_type), NULL);
|
|
|
|
g_return_val_if_fail (stock_prefix != NULL, NULL);
|
|
|
|
|
|
|
|
enum_class = g_type_class_ref (enum_type);
|
|
|
|
|
2003-02-06 02:23:58 +08:00
|
|
|
hbox = gtk_hbox_new (FALSE, 2);
|
2003-02-05 21:03:44 +08:00
|
|
|
g_object_weak_ref (G_OBJECT (hbox),
|
|
|
|
(GWeakNotify) g_type_class_unref, enum_class);
|
|
|
|
|
|
|
|
if (first_button)
|
|
|
|
*first_button = NULL;
|
|
|
|
|
|
|
|
for (value = enum_class->values; value->value_name; value++)
|
|
|
|
{
|
|
|
|
if (value->value < minimum || value->value > maximum)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
button = gtk_radio_button_new (group);
|
2003-10-26 03:00:49 +08:00
|
|
|
|
2003-02-06 02:23:58 +08:00
|
|
|
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
|
2003-02-05 21:03:44 +08:00
|
|
|
|
|
|
|
if (first_button && *first_button == NULL)
|
|
|
|
*first_button = button;
|
|
|
|
|
|
|
|
stock_id = g_strconcat (stock_prefix, "-", value->value_nick, NULL);
|
2003-02-19 00:29:28 +08:00
|
|
|
|
2003-03-31 20:09:09 +08:00
|
|
|
image = gtk_image_new_from_stock (stock_id, icon_size);
|
2003-02-05 21:03:44 +08:00
|
|
|
|
2003-02-19 00:29:28 +08:00
|
|
|
g_free (stock_id);
|
|
|
|
|
2003-02-05 21:03:44 +08:00
|
|
|
if (image)
|
|
|
|
{
|
|
|
|
gtk_container_add (GTK_CONTAINER (button), image);
|
|
|
|
gtk_widget_show (image);
|
|
|
|
}
|
|
|
|
|
2004-07-29 20:33:15 +08:00
|
|
|
gimp_help_set_help_data (button,
|
2004-10-26 01:55:25 +08:00
|
|
|
gimp_enum_value_get_desc (enum_class, value),
|
2004-07-29 20:33:15 +08:00
|
|
|
NULL);
|
2003-02-05 21:03:44 +08:00
|
|
|
|
|
|
|
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
g_object_set_data (G_OBJECT (button), "gimp-item-data",
|
|
|
|
GINT_TO_POINTER (value->value));
|
|
|
|
|
|
|
|
if (callback)
|
|
|
|
g_signal_connect (button, "toggled",
|
|
|
|
callback,
|
|
|
|
callback_data);
|
|
|
|
}
|
|
|
|
|
2003-10-26 03:00:49 +08:00
|
|
|
return hbox;
|
2003-02-05 21:03:44 +08:00
|
|
|
}
|
2004-02-21 20:25:09 +08:00
|
|
|
|
2005-01-22 09:50:15 +08:00
|
|
|
/**
|
|
|
|
* gimp_enum_stock_box_set_child_padding:
|
|
|
|
* @stock_box: a stock box widget
|
|
|
|
* @xpad: horizontal padding
|
|
|
|
* @ypad: vertical padding
|
|
|
|
*
|
|
|
|
* Sets the padding of all buttons in a box created by
|
|
|
|
* gimp_enum_stock_box_new().
|
2005-01-29 20:26:14 +08:00
|
|
|
*
|
|
|
|
* Since: GIMP 2.4
|
2005-01-22 09:50:15 +08:00
|
|
|
**/
|
2004-02-21 20:25:09 +08:00
|
|
|
void
|
|
|
|
gimp_enum_stock_box_set_child_padding (GtkWidget *stock_box,
|
|
|
|
gint xpad,
|
|
|
|
gint ypad)
|
|
|
|
{
|
2005-05-31 18:47:09 +08:00
|
|
|
GList *children;
|
2004-02-21 20:25:09 +08:00
|
|
|
GList *list;
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CONTAINER (stock_box));
|
|
|
|
|
2005-05-31 18:47:09 +08:00
|
|
|
children = gtk_container_get_children (GTK_CONTAINER (stock_box));
|
|
|
|
|
|
|
|
for (list = children; list; list = g_list_next (list))
|
2004-02-21 20:25:09 +08:00
|
|
|
{
|
2005-01-29 20:26:14 +08:00
|
|
|
GtkBin *bin = list->data;
|
2005-01-22 09:50:15 +08:00
|
|
|
|
|
|
|
if (GTK_IS_MISC (bin->child))
|
|
|
|
{
|
|
|
|
GtkMisc *misc = GTK_MISC (bin->child);
|
2004-02-21 20:25:09 +08:00
|
|
|
|
2005-01-22 09:50:15 +08:00
|
|
|
gtk_misc_set_padding (misc,
|
|
|
|
xpad < 0 ? misc->xpad : xpad,
|
|
|
|
ypad < 0 ? misc->ypad : ypad);
|
|
|
|
}
|
2004-02-21 20:25:09 +08:00
|
|
|
}
|
2005-05-31 18:47:09 +08:00
|
|
|
|
|
|
|
g_list_free (children);
|
2004-02-21 20:25:09 +08:00
|
|
|
}
|