summaryrefslogtreecommitdiff
path: root/gtk/gtkcheckmenuitem.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tvb@gnome.org>2008-11-06 17:19:08 +0000
committerTristan Van Berkom <tvb@src.gnome.org>2008-11-06 17:19:08 +0000
commit70a5f5388e7ebd416bf1c81dbacc49cdea9365f2 (patch)
tree72ff870c0fb7ad7063ea42d6e8c6478405f75b40 /gtk/gtkcheckmenuitem.c
parent71f27b36de67fe83662cc0c5e98d2b13ed4da3b0 (diff)
downloadgtk+-70a5f5388e7ebd416bf1c81dbacc49cdea9365f2.tar.gz
added new apis gtk_menu_item_[set/get]_label() and
2008-11-06 Tristan Van Berkom <tvb@gnome.org> * gtk/gtkmenuitem.[ch]: added new apis gtk_menu_item_[set/get]_label() and gtk_menu_item_[set/get]_use_underline() with "label" and "use-underline" properties, constructors cleaned up to use g_object_new(). GtkMenuItemClass take new vfuncs ->get/set_label(). * gtk/gtkcheckmenuitem.c: constructors cleaned up to use g_object_new(). * gtk/gtkimagemenuitem.[ch]: added new apis gtk_image_menu_item_[get/set]_use_stock() and gtk_image_menu_item_set_accel_group() with "use-stock" and write-only "accel-group" properties. constructors cleaned up to use g_object_new(). svn path=/trunk/; revision=21766
Diffstat (limited to 'gtk/gtkcheckmenuitem.c')
-rw-r--r--gtk/gtkcheckmenuitem.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c
index b7f35cb361..a179ab24e0 100644
--- a/gtk/gtkcheckmenuitem.c
+++ b/gtk/gtkcheckmenuitem.c
@@ -143,18 +143,9 @@ gtk_check_menu_item_new (void)
GtkWidget*
gtk_check_menu_item_new_with_label (const gchar *label)
{
- GtkWidget *check_menu_item;
- GtkWidget *accel_label;
-
- check_menu_item = gtk_check_menu_item_new ();
- accel_label = gtk_accel_label_new (label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
-
- gtk_container_add (GTK_CONTAINER (check_menu_item), accel_label);
- gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), check_menu_item);
- gtk_widget_show (accel_label);
-
- return check_menu_item;
+ return g_object_new (GTK_TYPE_CHECK_MENU_ITEM,
+ "label", label,
+ NULL);
}
@@ -171,19 +162,10 @@ gtk_check_menu_item_new_with_label (const gchar *label)
GtkWidget*
gtk_check_menu_item_new_with_mnemonic (const gchar *label)
{
- GtkWidget *check_menu_item;
- GtkWidget *accel_label;
-
- check_menu_item = gtk_check_menu_item_new ();
- accel_label = g_object_new (GTK_TYPE_ACCEL_LABEL, NULL);
- gtk_label_set_text_with_mnemonic (GTK_LABEL (accel_label), label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
-
- gtk_container_add (GTK_CONTAINER (check_menu_item), accel_label);
- gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label), check_menu_item);
- gtk_widget_show (accel_label);
-
- return check_menu_item;
+ return g_object_new (GTK_TYPE_CHECK_MENU_ITEM,
+ "label", label,
+ "use-underline", TRUE,
+ NULL);
}
void