Patch to add ''gtk_x_new_with_mnemonic' functions
- From: Jeff Franks <jcf tpg com au>
- To: gtk-devel-list gnome org
- Subject: Patch to add ''gtk_x_new_with_mnemonic' functions
- Date: Wed, 30 May 2001 11:25:55 +1000
Hi,
I wanted to try and help for a change rather than just report problems
so I put together this, my first patch. It adds the missing
'gtk_x_new_with_mnemonic' functions to the following widgets:
GtkRadioButton
GtkToggleButton
GtkCheckMenuItem
GtkImageMenuItem
GtkMenuItem
GtkRadioMenutIem
I hope this is acceptable because I would like to upload it somewhere
(?) so it can be applied. I need menuitem underscore accelerators to
work so I can start using them.
Jeff.
--- patch follows ---
Only in new-gtk+/gtk/.pics/med: tree_minus.xpm
Only in new-gtk+/gtk/.pics/med: tree_plus.xbm
Only in new-gtk+/gtk/.pics/med: tree_plus.xpm
diff -ru new-gtk+/gtk/gtkcheckmenuitem.c gtk+/gtk/gtkcheckmenuitem.c
--- new-gtk+/gtk/gtkcheckmenuitem.c Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkcheckmenuitem.c Thu Mar 29 10:24:56 2001
@@ -165,25 +165,6 @@
return check_menu_item;
}
-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 = gtk_type_new (GTK_TYPE_ACCEL_LABEL);
- gtk_label_set_text_with_mnemonic (GTK_LABEL (accel_label), label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
- gtk_label_set_mnemonic_widget (GTK_LABEL (accel_label), check_menu_item);
-
- 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;
-}
-
void
gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
gboolean is_active)
diff -ru new-gtk+/gtk/gtkcheckmenuitem.h gtk+/gtk/gtkcheckmenuitem.h
--- new-gtk+/gtk/gtkcheckmenuitem.h Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkcheckmenuitem.h Sat Mar 24 10:39:24 2001
@@ -70,7 +70,6 @@
GtkType gtk_check_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_check_menu_item_new (void);
GtkWidget* gtk_check_menu_item_new_with_label (const gchar *label);
-GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
gboolean is_active);
void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);
diff -ru new-gtk+/gtk/gtkimagemenuitem.c gtk+/gtk/gtkimagemenuitem.c
--- new-gtk+/gtk/gtkimagemenuitem.c Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkimagemenuitem.c Sat May 19 03:35:20 2001
@@ -354,28 +354,6 @@
}
GtkWidget*
-gtk_image_menu_item_new_with_menmonic (const gchar *label)
-{
- GtkImageMenuItem *image_menu_item;
- GtkWidget *accel_label;
-
- image_menu_item = GTK_IMAGE_MENU_ITEM (g_object_new
(GTK_TYPE_IMAGE_MENU_ITEM,
- NULL));
-
- accel_label = gtk_type_new (GTK_TYPE_ACCEL_LABEL);
- gtk_label_set_text_with_mnemonic (GTK_LABEL (accel_label), label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
- gtk_label_set_mnemonic_widget (GTK_LABEL (accel_label),
GTK_WIDGET(image_menu_item));
-
- gtk_container_add (GTK_CONTAINER (image_menu_item), accel_label);
- gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
- GTK_WIDGET (image_menu_item));
- gtk_widget_show (accel_label);
-
- return GTK_WIDGET(image_menu_item);
-}
-
-GtkWidget*
gtk_image_menu_item_new_from_stock (const gchar *stock_id,
GtkAccelGroup *accel_group)
{
diff -ru new-gtk+/gtk/gtkimagemenuitem.h gtk+/gtk/gtkimagemenuitem.h
--- new-gtk+/gtk/gtkimagemenuitem.h Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkimagemenuitem.h Sat May 19 03:35:20 2001
@@ -65,7 +65,6 @@
GtkType gtk_image_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_image_menu_item_new (void);
GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label);
-GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label);
GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id,
GtkAccelGroup *accel_group);
void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item,
diff -ru new-gtk+/gtk/gtkmenuitem.c gtk+/gtk/gtkmenuitem.c
--- new-gtk+/gtk/gtkmenuitem.c Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkmenuitem.c Sun Apr 1 17:32:39 2001
@@ -229,25 +229,6 @@
return menu_item;
}
-GtkWidget*
-gtk_menu_item_new_with_mnemonic (const gchar *label)
-{
- GtkWidget *menu_item;
- GtkWidget *accel_label;
-
- menu_item = gtk_menu_item_new ();
- accel_label = gtk_type_new (GTK_TYPE_ACCEL_LABEL);
- gtk_label_set_text_with_mnemonic (GTK_LABEL (accel_label), label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
- gtk_label_set_mnemonic_widget (GTK_LABEL (accel_label), menu_item);
-
- gtk_container_add (GTK_CONTAINER (menu_item), accel_label);
- gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
menu_item);
- gtk_widget_show (accel_label);
-
- return menu_item;
-}
-
static void
gtk_menu_item_destroy (GtkObject *object)
{
diff -ru new-gtk+/gtk/gtkmenuitem.h gtk+/gtk/gtkmenuitem.h
--- new-gtk+/gtk/gtkmenuitem.h Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkmenuitem.h Sat Mar 17 07:12:39 2001
@@ -90,7 +90,6 @@
GtkType gtk_menu_item_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_menu_item_new (void);
GtkWidget* gtk_menu_item_new_with_label (const gchar *label);
-GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
void gtk_menu_item_set_submenu (GtkMenuItem *menu_item,
GtkWidget *submenu);
void gtk_menu_item_remove_submenu (GtkMenuItem *menu_item);
diff -ru new-gtk+/gtk/gtkradiobutton.c gtk+/gtk/gtkradiobutton.c
--- new-gtk+/gtk/gtkradiobutton.c Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkradiobutton.c Tue Apr 3 01:51:26 2001
@@ -230,24 +230,6 @@
}
GtkWidget*
-gtk_radio_button_new_with_mnemonic (GSList *group,
- const gchar *label)
-{
- GtkWidget *radio_button;
- GtkWidget *label_widget;
-
- radio_button = gtk_radio_button_new (group);
- label_widget = gtk_label_new_with_mnemonic (label);
- gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label_widget), radio_button);
-
- gtk_container_add (GTK_CONTAINER (radio_button), label_widget);
- gtk_widget_show (label_widget);
-
- return radio_button;
-}
-
-GtkWidget*
gtk_radio_button_new_from_widget (GtkRadioButton *group)
{
GSList *l = NULL;
@@ -265,16 +247,6 @@
if (group)
l = gtk_radio_button_group (group);
return gtk_radio_button_new_with_label (l, label);
-}
-
-GtkWidget*
-gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group,
- const gchar *label)
-{
- GSList *l = NULL;
- if (group)
- l = gtk_radio_button_group (group);
- return gtk_radio_button_new_with_mnemonic (l, label);
}
GSList*
diff -ru new-gtk+/gtk/gtkradiobutton.h gtk+/gtk/gtkradiobutton.h
--- new-gtk+/gtk/gtkradiobutton.h Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkradiobutton.h Wed Aug 30 11:33:38 2000
@@ -68,10 +68,6 @@
const gchar *label);
GtkWidget* gtk_radio_button_new_with_label_from_widget (GtkRadioButton
*group,
const gchar *label);
-GtkWidget* gtk_radio_button_new_with_mnemonic (GSList *group,
- const gchar *label);
-GtkWidget* gtk_radio_button_new_with_mnemonic_from_widget
(GtkRadioButton *group,
- const gchar *label);
GSList* gtk_radio_button_group (GtkRadioButton *radio_button);
void gtk_radio_button_set_group (GtkRadioButton *radio_button,
GSList *group);
diff -ru new-gtk+/gtk/gtkradiomenuitem.c gtk+/gtk/gtkradiomenuitem.c
--- new-gtk+/gtk/gtkradiomenuitem.c Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkradiomenuitem.c Tue Feb 20 09:25:29 2001
@@ -138,26 +138,6 @@
return radio_menu_item;
}
-GtkWidget*
-gtk_radio_menu_item_new_with_mnemonic (GSList *group,
- const gchar *label)
-{
- GtkWidget *radio_menu_item;
- GtkWidget *accel_label;
-
- radio_menu_item = gtk_radio_menu_item_new (group);
- accel_label = gtk_type_new (GTK_TYPE_ACCEL_LABEL);
- gtk_label_set_text_with_mnemonic (GTK_LABEL (accel_label), label);
- gtk_misc_set_alignment (GTK_MISC (accel_label), 0.0, 0.5);
- gtk_label_set_mnemonic_widget (GTK_LABEL (accel_label), radio_menu_item);
-
- gtk_container_add (GTK_CONTAINER (radio_menu_item), accel_label);
- gtk_accel_label_set_accel_widget (GTK_ACCEL_LABEL (accel_label),
radio_menu_item);
- gtk_widget_show (accel_label);
-
- return radio_menu_item;
-}
-
GSList*
gtk_radio_menu_item_group (GtkRadioMenuItem *radio_menu_item)
{
diff -ru new-gtk+/gtk/gtkradiomenuitem.h gtk+/gtk/gtkradiomenuitem.h
--- new-gtk+/gtk/gtkradiomenuitem.h Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtkradiomenuitem.h Wed Aug 30 11:33:38 2000
@@ -65,8 +65,6 @@
GtkWidget* gtk_radio_menu_item_new (GSList *group);
GtkWidget* gtk_radio_menu_item_new_with_label (GSList *group,
const gchar *label);
-GtkWidget* gtk_radio_menu_item_new_with_mnemonic (GSList *group,
- const gchar *label);
GSList* gtk_radio_menu_item_group (GtkRadioMenuItem *radio_menu_item);
void gtk_radio_menu_item_set_group (GtkRadioMenuItem *radio_menu_item,
GSList *group);
diff -ru new-gtk+/gtk/gtktogglebutton.c gtk+/gtk/gtktogglebutton.c
--- new-gtk+/gtk/gtktogglebutton.c Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtktogglebutton.c Mon May 14 08:41:30 2001
@@ -202,23 +202,6 @@
return toggle_button;
}
-GtkWidget*
-gtk_toggle_button_new_with_menmonic (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_label_set_mnemonic_widget (GTK_LABEL (label_widget), toggle_button);
-
- gtk_container_add (GTK_CONTAINER (toggle_button), label_widget);
- gtk_widget_show (label_widget);
-
- return toggle_button;
-}
-
static void
gtk_toggle_button_set_property (GObject *object,
guint prop_id,
diff -ru new-gtk+/gtk/gtktogglebutton.h gtk+/gtk/gtktogglebutton.h
--- new-gtk+/gtk/gtktogglebutton.h Wed May 30 10:14:40 2001
+++ gtk+/gtk/gtktogglebutton.h Tue Feb 20 09:25:30 2001
@@ -70,7 +70,6 @@
GtkType gtk_toggle_button_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_toggle_button_new (void);
GtkWidget* gtk_toggle_button_new_with_label (const gchar *label);
-GtkWidget* gtk_toggle_button_new_with_mnemonic (const gchar *label);
void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
gboolean draw_indicator);
void gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]