Commit de5eafed authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and removed

2001-03-21  Alexander Larsson  <alexl@redhat.com>

        * gtk/gtkbutton.[ch]:
	* gtk/gtkdialog.c:
	Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
	removed accel_group argument. Renamed gtk_button_new_accel() to
	gtk_button_new_with_mnemonic() and removed accel_group argument.

	* gtk/gtkcheckbutton.[ch]:
	New function gtk_check_button_new_with_mnemonic().

	* gtk/gtkentry.c:
	Override activate_mnemonic and just grab focus.

	* gtk/gtkitemfactory.c:
	Don't add menu uline accel group, instead use mnemonics support.

	* gtk/gtklabel.[ch]:
	New support for mnemonics.

	* gtk/gtkmarshal.list:
	Needed BOOLEAN:BOOLEAN for activate_mnemonic.

	* gtk/gtkmenu.[c]:
	* gtkmenushell.c:
	Use mnemonics instead of accel groups for uline
	support in menu items.
	Removed gtk_menu_get_uline_accel_group() and
	gtk_menu_ensure_uline_accel_group().

	* gtk/gtkmenuitem.c:
	Override activate_mnemonic to handle switching between
	menu items if there are collisions.

	* gtk/gtknotebook.c:
	Connect to activate_mnemonic on the tab_label, so that
	activating it switches to that notebook page.

	* gtk/gtkwidget.[ch]:
	Add activate_mnemonic signal. New function
	gtk_widget_activate_mnemonic() to emit it.
	Default implementation does activate/grab_focus.

	* gtk/gtkwindow.[ch]:
	Add support for mnemonics in windows.
	New functions:
	gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
	gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier

	* gtk/testgtk.c:
	Update to function name changes.
parent a24e9b10
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkbutton.[ch]:
* gtk/gtkdialog.c:
Renamed gtk_button_new_stock() to gtk_button_new_from_stock() and
removed accel_group argument. Renamed gtk_button_new_accel() to
gtk_button_new_with_mnemonic() and removed accel_group argument.
* gtk/gtkcheckbutton.[ch]:
New function gtk_check_button_new_with_mnemonic().
* gtk/gtkentry.c:
Override activate_mnemonic and just grab focus.
* gtk/gtkitemfactory.c:
Don't add menu uline accel group, instead use mnemonics support.
* gtk/gtklabel.[ch]:
New support for mnemonics.
* gtk/gtkmarshal.list:
Needed BOOLEAN:BOOLEAN for activate_mnemonic.
* gtk/gtkmenu.[c]:
* gtkmenushell.c:
Use mnemonics instead of accel groups for uline
support in menu items.
Removed gtk_menu_get_uline_accel_group() and
gtk_menu_ensure_uline_accel_group().
* gtk/gtkmenuitem.c:
Override activate_mnemonic to handle switching between
menu items if there are collisions.
* gtk/gtknotebook.c:
Connect to activate_mnemonic on the tab_label, so that
activating it switches to that notebook page.
* gtk/gtkwidget.[ch]:
Add activate_mnemonic signal. New function
gtk_widget_activate_mnemonic() to emit it.
Default implementation does activate/grab_focus.
* gtk/gtkwindow.[ch]:
Add support for mnemonics in windows.
New functions:
gtk_window_add_mnemonic, gtk_window_remove_mnemonic,
gtk_window_activate_mnemonic, gtk_window_set_mnemonic_modifier
* gtk/testgtk.c:
Update to function name changes.
2001-03-21 Alexander Larsson <alexl@redhat.com>
* gtk/gtkimagemenuitem.[c]:
......
......@@ -319,9 +319,17 @@ gtk_button_new_with_label (const gchar *label)
return button;
}
/**
* gtk_button_new_from_stock:
* @stock_id: the name of the stock item
* @returns: a new #GtkButton
*
* Creates a new #GtkButton containing the image and text from a stock item.
* Some stock ids have preprocessor macros like #GTK_STOCK_BUTTON_OK and
* #GTK_STOCK_BUTTON_APPLY.
**/
GtkWidget*
gtk_button_new_stock (const gchar *stock_id,
GtkAccelGroup *accel_group)
gtk_button_new_from_stock (const gchar *stock_id)
{
GtkWidget *button;
GtkStockItem item;
......@@ -331,34 +339,12 @@ gtk_button_new_stock (const gchar *stock_id,
GtkWidget *label;
GtkWidget *image;
GtkWidget *hbox;
guint keyval;
button = gtk_button_new ();
label = gtk_label_new (NULL);
keyval = gtk_label_parse_uline (GTK_LABEL (label),
item.label);
if (keyval && accel_group)
{
gtk_widget_add_accelerator (button,
"clicked",
accel_group,
keyval,
GDK_MOD1_MASK,
GTK_ACCEL_LOCKED);
}
/* Also add the stock accelerator if one was specified. */
if (item.keyval && accel_group)
{
gtk_widget_add_accelerator (button,
"clicked",
accel_group,
item.keyval,
item.modifier,
GTK_ACCEL_LOCKED);
}
label = gtk_label_new_with_mnemonic (item.label);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), button);
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_BUTTON);
hbox = gtk_hbox_new (FALSE, 0);
......@@ -371,37 +357,37 @@ gtk_button_new_stock (const gchar *stock_id,
}
else
{
button = gtk_button_new_accel (stock_id, accel_group);
button = gtk_button_new_with_mnemonic (stock_id);
}
return button;
}
/**
* gtk_button_new_with_mnemonic:
* @label: The text of the button, with an underscore in front of the
* mnemonic character
* @returns: a new #GtkButton
*
* Creates a new #GtkButton containing a label.
* If characters in @label are preceded by an underscore, they are underlined
* indicating that they represent a keyboard accelerator called a mnemonic.
* Pressing Alt and that key activates the button.
**/
GtkWidget*
gtk_button_new_accel (const gchar *uline_label,
GtkAccelGroup *accel_group)
gtk_button_new_with_mnemonic (const gchar *label)
{
GtkWidget *button;
GtkWidget *label;
guint keyval;
GtkWidget *label_widget;
button = gtk_button_new ();
label = gtk_label_new (NULL);
keyval = gtk_label_parse_uline (GTK_LABEL (label), uline_label);
label_widget = gtk_label_new_with_mnemonic (label);
if (keyval && accel_group)
{
gtk_widget_add_accelerator (button,
"clicked",
accel_group,
keyval,
GDK_MOD1_MASK,
GTK_ACCEL_LOCKED);
}
gtk_label_set_mnemonic_widget (GTK_LABEL (label_widget), button);
gtk_container_add (GTK_CONTAINER (button), label);
gtk_widget_show (label);
gtk_container_add (GTK_CONTAINER (button), label_widget);
gtk_widget_show (label_widget);
return button;
}
......
......@@ -77,20 +77,18 @@ struct _GtkButtonClass
GtkType gtk_button_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_button_new (void);
GtkWidget* gtk_button_new_with_label (const gchar *label);
GtkWidget* gtk_button_new_stock (const gchar *stock_id,
GtkAccelGroup *accel_group);
GtkWidget* gtk_button_new_accel (const gchar *uline_label,
GtkAccelGroup *accel_group);
void gtk_button_pressed (GtkButton *button);
void gtk_button_released (GtkButton *button);
void gtk_button_clicked (GtkButton *button);
void gtk_button_enter (GtkButton *button);
void gtk_button_leave (GtkButton *button);
void gtk_button_set_relief (GtkButton *button,
GtkReliefStyle newstyle);
GtkReliefStyle gtk_button_get_relief (GtkButton *button);
GtkWidget* gtk_button_new (void);
GtkWidget* gtk_button_new_with_label (const gchar *label);
GtkWidget* gtk_button_new_from_stock (const gchar *stock_id);
GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
void gtk_button_pressed (GtkButton *button);
void gtk_button_released (GtkButton *button);
void gtk_button_clicked (GtkButton *button);
void gtk_button_enter (GtkButton *button);
void gtk_button_leave (GtkButton *button);
void gtk_button_set_relief (GtkButton *button,
GtkReliefStyle newstyle);
GtkReliefStyle gtk_button_get_relief (GtkButton *button);
#ifdef __cplusplus
......
......@@ -123,6 +123,35 @@ gtk_check_button_new_with_label (const gchar *label)
return check_button;
}
/**
* gtk_check_button_new_with_mnemonic:
* @label: The text of the button, with an underscore in front of the
* mnemonic character
* @returns: a new #GtkCheckButton
*
* Creates a new #GtkCheckButton containing a label.
* If characters in @label are preceded by an underscore, they are underlined
* indicating that they represent a keyboard accelerator called a mnemonic.
* Pressing Alt and that key activates the checkbutton.
**/
GtkWidget*
gtk_check_button_new_with_mnemonic (const gchar *label)
{
GtkWidget *check_button;
GtkWidget *label_widget;
check_button = gtk_check_button_new ();
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), check_button);
gtk_container_add (GTK_CONTAINER (check_button), label_widget);
gtk_widget_show (label_widget);
return check_button;
}
/* This should only be called when toggle_button->draw_indicator
* is true.
*/
......
......@@ -66,8 +66,9 @@ struct _GtkCheckButtonClass
GtkType gtk_check_button_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_check_button_new (void);
GtkWidget* gtk_check_button_new_with_label (const gchar *label);
GtkWidget* gtk_check_button_new (void);
GtkWidget* gtk_check_button_new_with_label (const gchar *label);
GtkWidget* gtk_check_button_new_with_mnemonic (const gchar *label);
#ifdef __cplusplus
......
......@@ -471,8 +471,7 @@ gtk_dialog_add_button (GtkDialog *dialog,
g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
g_return_val_if_fail (button_text != NULL, NULL);
button = gtk_button_new_stock (button_text,
gtk_window_get_default_accel_group (GTK_WINDOW (dialog)));
button = gtk_button_new_from_stock (button_text);
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
......
......@@ -250,6 +250,8 @@ static void gtk_entry_paste (GtkEntry *entry,
static void gtk_entry_update_primary_selection (GtkEntry *entry);
static void gtk_entry_popup_menu (GtkEntry *entry,
GdkEventButton *event);
static gboolean gtk_entry_activate_mnemonic (GtkWidget *widget,
gboolean group_cycling);
static GtkWidgetClass *parent_class = NULL;
......@@ -341,6 +343,7 @@ gtk_entry_class_init (GtkEntryClass *class)
widget_class->style_set = gtk_entry_style_set;
widget_class->direction_changed = gtk_entry_direction_changed;
widget_class->state_changed = gtk_entry_state_changed;
widget_class->activate_mnemonic = gtk_entry_activate_mnemonic;
widget_class->drag_motion = gtk_entry_drag_motion;
widget_class->drag_leave = gtk_entry_drag_leave;
......@@ -3133,6 +3136,15 @@ activate_cb (GtkWidget *menuitem,
gtk_signal_emit_by_name (GTK_OBJECT (entry), signal);
}
static gboolean
gtk_entry_activate_mnemonic (GtkWidget *widget,
gboolean group_cycling)
{
gtk_widget_grab_focus (widget);
return TRUE;
}
static void
append_action_signal (GtkEntry *entry,
GtkWidget *menu,
......
......@@ -1228,24 +1228,7 @@ gtk_item_factory_create_item (GtkItemFactory *ifactory,
"GtkMisc::xalign", 0.0,
NULL);
accel_key = gtk_label_parse_uline (GTK_LABEL (label), name);
if (accel_key != GDK_VoidSymbol)
{
if (GTK_IS_MENU_BAR (parent))
gtk_widget_add_accelerator (widget,
"activate_item",
ifactory->accel_group,
accel_key, GDK_MOD1_MASK,
GTK_ACCEL_LOCKED);
if (GTK_IS_MENU (parent))
gtk_widget_add_accelerator (widget,
"activate_item",
gtk_menu_ensure_uline_accel_group (GTK_MENU (parent)),
accel_key, 0,
GTK_ACCEL_LOCKED);
}
gtk_label_set_text_with_mnemonic (GTK_LABEL (label), name);
}
g_free (name);
......
......@@ -26,11 +26,15 @@
#include <math.h>
#include <string.h>
#include "gtklabel.h"
#include "gtksignal.h"
#include "gtkwindow.h"
#include "gdk/gdkkeysyms.h"
#include "gtkclipboard.h"
#include "gdk/gdki18n.h"
#include <pango/pango.h>
#include "gtkintl.h"
#include "gtkmenuitem.h"
#include "gtknotebook.h"
struct _GtkLabelSelectionInfo
{
......@@ -39,6 +43,7 @@ struct _GtkLabelSelectionInfo
gint selection_end;
};
enum {
PROP_0,
PROP_LABEL,
......@@ -49,7 +54,7 @@ enum {
PROP_PATTERN,
PROP_WRAP,
PROP_SELECTABLE,
PROP_ACCEL_KEYVAL
PROP_MNEMONIC_KEYVAL
};
static void gtk_label_class_init (GtkLabelClass *klass);
......@@ -57,13 +62,11 @@ static void gtk_label_init (GtkLabel *label);
static void gtk_label_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec,
const gchar *trailer);
GParamSpec *pspec);
static void gtk_label_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec,
const gchar *trailer);
GParamSpec *pspec);
static void gtk_label_finalize (GObject *object);
static void gtk_label_size_request (GtkWidget *widget,
GtkRequisition *requisition);
......@@ -106,6 +109,7 @@ static void set_markup (GtkLabel *label,
const gchar *str,
gboolean with_uline);
static void gtk_label_recalculate (GtkLabel *label);
static void gtk_label_hierarchy_changed (GtkWidget *widget);
static void gtk_label_create_window (GtkLabel *label);
static void gtk_label_destroy_window (GtkLabel *label);
......@@ -117,6 +121,9 @@ static void gtk_label_select_region_index (GtkLabel *label,
gint anchor_index,
gint end_index);
static gboolean gtk_label_activate_mnemonic (GtkWidget *widget,
gboolean group_cycling);
static GtkMiscClass *parent_class = NULL;
......@@ -175,6 +182,8 @@ gtk_label_class_init (GtkLabelClass *class)
widget_class->button_press_event = gtk_label_button_press;
widget_class->button_release_event = gtk_label_button_release;
widget_class->motion_notify_event = gtk_label_motion;
widget_class->hierarchy_changed = gtk_label_hierarchy_changed;
widget_class->activate_mnemonic = gtk_label_activate_mnemonic;
g_object_class_install_property (G_OBJECT_CLASS(object_class),
PROP_LABEL,
......@@ -201,7 +210,7 @@ gtk_label_class_init (GtkLabelClass *class)
PROP_USE_UNDERLINE,
g_param_spec_boolean ("use_underline",
_("Use underline"),
_("If set, an underline in the text indicates the next character should be used for the accelerator key"),
_("If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key"),
FALSE,
G_PARAM_READWRITE));
......@@ -237,22 +246,22 @@ gtk_label_class_init (GtkLabelClass *class)
FALSE,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
PROP_ACCEL_KEYVAL,
g_param_spec_uint ("accel_keyval",
_("Accelerator key value"),
_("The accelerator key for this label."),
PROP_MNEMONIC_KEYVAL,
g_param_spec_uint ("mnemonic_keyval",
_("Mnemonic accelerator key value"),
_("The mnemonic accelerator key for this label."),
0,
G_MAXUINT,
GDK_VoidSymbol,
G_PARAM_READABLE));
}
static void
gtk_label_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec,
const gchar *trailer)
GParamSpec *pspec)