summaryrefslogtreecommitdiff
path: root/gtk/gtktogglebutton.c
diff options
context:
space:
mode:
authorAlexander Larsson <alla@lysator.liu.se>2001-08-27 01:05:07 +0000
committerAlexander Larsson <alexl@src.gnome.org>2001-08-27 01:05:07 +0000
commitf9e666244fb25940b113cd35dbed18d0f75c4f44 (patch)
treea7647e917586f524dba60b1bed78054c1e21fef4 /gtk/gtktogglebutton.c
parent8d00215d9ed8a40f17fa6658bc30520b2fc8d03d (diff)
downloadgtk+-f9e666244fb25940b113cd35dbed18d0f75c4f44.tar.gz
Add properties for labels, mnemonics and stock items. Added C accessor
2001-08-26 Alexander Larsson <alla@lysator.liu.se> * gtk/gtkbutton.[ch]: Add properties for labels, mnemonics and stock items. Added C accessor functions for the properties. Removed deprecated button->child. * gtk/gtkradiobutton.c: * gtk/gtktogglebutton.c: Update to use the functions in GtkButton. * gtk/gtkcheckbutton.c: Update to use the functions in GtkButton. Changed size allocation of child. Now only gets as much space as it requests. * gtk/gtkclist.c: Don't use GtkButton->child * gtk/gtklabel.c: Fixed typo in docs
Diffstat (limited to 'gtk/gtktogglebutton.c')
-rw-r--r--gtk/gtktogglebutton.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index af60088675..5d32d97306 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -187,17 +187,7 @@ gtk_toggle_button_new (void)
GtkWidget*
gtk_toggle_button_new_with_label (const gchar *label)
{
- GtkWidget *toggle_button;
- GtkWidget *label_widget;
-
- toggle_button = gtk_toggle_button_new ();
- label_widget = gtk_label_new (label);
- gtk_misc_set_alignment (GTK_MISC (label_widget), 0.5, 0.5);
-
- gtk_container_add (GTK_CONTAINER (toggle_button), label_widget);
- gtk_widget_show (label_widget);
-
- return toggle_button;
+ return g_object_new (GTK_TYPE_TOGGLE_BUTTON, "label", label, NULL);
}
/**
@@ -213,17 +203,7 @@ gtk_toggle_button_new_with_label (const gchar *label)
GtkWidget*
gtk_toggle_button_new_with_mnemonic (const gchar *label)
{
- GtkWidget *toggle_button;
- GtkWidget *label_widget;
-
- toggle_button = gtk_toggle_button_new ();
- label_widget = gtk_label_new_with_mnemonic (label);
- gtk_misc_set_alignment (GTK_MISC (label_widget), 0.5, 0.5);
-
- gtk_container_add (GTK_CONTAINER (toggle_button), label_widget);
- gtk_widget_show (label_widget);
-
- return toggle_button;
+ return g_object_new (GTK_TYPE_TOGGLE_BUTTON, "label", label, "use_underline", TRUE, NULL);
}
static void