mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
Add a write-only property ::group to be consistent with GtkRadioAction and
Sat Jan 24 17:38:48 2004 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_class_init): Add a write-only property ::group to be consistent with GtkRadioAction and GtkRadioButton. (#132159, Patch from Olivier Andrieu)
This commit is contained in:
parent
ff32f555f0
commit
c2afbf7955
@ -1,3 +1,10 @@
|
||||
Sat Jan 24 17:38:48 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_class_init):
|
||||
Add a write-only property ::group to be consistent with
|
||||
GtkRadioAction and GtkRadioButton. (#132159, Patch from Olivier
|
||||
Andrieu)
|
||||
|
||||
Fri Jan 23 23:46:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_label_use_font): Don't leak the
|
||||
|
@ -1,3 +1,10 @@
|
||||
Sat Jan 24 17:38:48 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_class_init):
|
||||
Add a write-only property ::group to be consistent with
|
||||
GtkRadioAction and GtkRadioButton. (#132159, Patch from Olivier
|
||||
Andrieu)
|
||||
|
||||
Fri Jan 23 23:46:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_label_use_font): Don't leak the
|
||||
|
@ -1,3 +1,10 @@
|
||||
Sat Jan 24 17:38:48 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_class_init):
|
||||
Add a write-only property ::group to be consistent with
|
||||
GtkRadioAction and GtkRadioButton. (#132159, Patch from Olivier
|
||||
Andrieu)
|
||||
|
||||
Fri Jan 23 23:46:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_label_use_font): Don't leak the
|
||||
|
@ -1,3 +1,10 @@
|
||||
Sat Jan 24 17:38:48 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_class_init):
|
||||
Add a write-only property ::group to be consistent with
|
||||
GtkRadioAction and GtkRadioButton. (#132159, Patch from Olivier
|
||||
Andrieu)
|
||||
|
||||
Fri Jan 23 23:46:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_label_use_font): Don't leak the
|
||||
|
@ -1,3 +1,10 @@
|
||||
Sat Jan 24 17:38:48 2004 Soeren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* gtk/gtkradiotoolbutton.c (gtk_radio_tool_button_class_init):
|
||||
Add a write-only property ::group to be consistent with
|
||||
GtkRadioAction and GtkRadioButton. (#132159, Patch from Olivier
|
||||
Andrieu)
|
||||
|
||||
Fri Jan 23 23:46:12 2004 Matthias Clasen <maclas@gmx.de>
|
||||
|
||||
* gtk/gtkfontbutton.c (gtk_font_button_label_use_font): Don't leak the
|
||||
|
@ -24,8 +24,17 @@
|
||||
#include "gtkradiobutton.h"
|
||||
#include "gtkintl.h"
|
||||
|
||||
static void gtk_radio_tool_button_init (GtkRadioToolButton *button);
|
||||
static void gtk_radio_tool_button_class_init (GtkRadioToolButtonClass *klass);
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_GROUP
|
||||
};
|
||||
|
||||
static void gtk_radio_tool_button_init (GtkRadioToolButton *button);
|
||||
static void gtk_radio_tool_button_class_init (GtkRadioToolButtonClass *klass);
|
||||
static void gtk_radio_tool_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
GType
|
||||
gtk_radio_tool_button_get_type (void)
|
||||
@ -57,11 +66,31 @@ gtk_radio_tool_button_get_type (void)
|
||||
static void
|
||||
gtk_radio_tool_button_class_init (GtkRadioToolButtonClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
GtkToolButtonClass *toolbutton_class;
|
||||
|
||||
object_class = (GObjectClass *)klass;
|
||||
toolbutton_class = (GtkToolButtonClass *)klass;
|
||||
|
||||
object_class->set_property = gtk_radio_tool_button_set_property;
|
||||
|
||||
toolbutton_class->button_type = GTK_TYPE_RADIO_BUTTON;
|
||||
|
||||
/**
|
||||
* GtkRadioToolButton:group:
|
||||
*
|
||||
* Sets a new group for a radio tool button.
|
||||
*
|
||||
* Since: 2.4
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_GROUP,
|
||||
g_param_spec_object ("group",
|
||||
_("Group"),
|
||||
_("The radio tool button whose group this button belongs to."),
|
||||
GTK_TYPE_RADIO_TOOL_BUTTON,
|
||||
G_PARAM_WRITABLE));
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
@ -71,6 +100,37 @@ gtk_radio_tool_button_init (GtkRadioToolButton *button)
|
||||
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (_gtk_tool_button_get_button (tool_button)), FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_radio_tool_button_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GtkRadioToolButton *button;
|
||||
|
||||
button = GTK_RADIO_TOOL_BUTTON (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_GROUP:
|
||||
{
|
||||
GtkRadioToolButton *arg;
|
||||
GSList *slist = NULL;
|
||||
if (G_VALUE_HOLDS_OBJECT (value))
|
||||
{
|
||||
arg = GTK_RADIO_TOOL_BUTTON (g_value_get_object (value));
|
||||
if (arg)
|
||||
slist = gtk_radio_tool_button_get_group (arg);
|
||||
gtk_radio_tool_button_set_group (button, slist);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_radio_tool_button_new:
|
||||
* @group: An existing radio button group, or %NULL if you are creating a new group
|
||||
|
Loading…
Reference in New Issue
Block a user