Commit 7e9b154f authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

fix warning

2001-04-27  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning

	* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable

	* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
	line/para separators
	(gtk_entry_create_layout): set single paragraph mode on the layout

	* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
	spacing between the image and label; instead, inside a button box
	the button will get extra space that will go there, but if people
	configure button box for 0 chubbiness, then there's no spacing.

	* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
	and min/max size style properties, so people can tune their
	chubbiness.

	* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
	functions

	* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
	space_style, and button_relief into style properties, remove
	functions for setting them

	* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
	it back down

	* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
	types from gtk_widget_style_get

	* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
	with a style property.

	* gdk/x11/gdkevents-x11.c: namespace the settings

	* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.

	* gtk/gtksettings.c (gtk_settings_class_init): remove code with
	side effects from inside g_assert(), so that G_DISABLE_ASSERT can
	be used. Also, translate doc strings for settings. Also, namespace
	the double-click-time property. Also, remove bell properties crap.
parent 8ff2bf3b
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-27 Sven Neumann <sven@gimp.org>
* Makefile.am: before creating links, check if pkg-config files
......
......@@ -56,18 +56,3 @@ Adds a new #GtkMenuItem to the GtkMenuBar at the position defined by @position
@position: the position in the item list where the @child is added.
<!-- ##### FUNCTION gtk_menu_bar_set_shadow_type ##### -->
<para>
Sets the shadow type to use on the GtkMenuBar. The shadow types to use are:
GTK_SHADOW_NONE, GTK_SHADOW_IN, GTK_SHADOW_OUT, GTK_SHADOW_ETCHED_IN, and GTK_SHADOW_ETCHED_OUT
</para>
@menu_bar: a #GtkMenuBar
@type: the GtkShadowtype
<!-- ##### ARG GtkMenuBar:shadow ##### -->
<para>
Used by #GtkMenuBar to determine the shadow type.
</para>
......@@ -496,6 +496,7 @@ This can later be composited together with other
#GtkRcStyle structures to form a #GtkStyle.
</para>
@parent_instance:
@name:
@bg_pixmap_name:
@font_desc:
......
......@@ -258,24 +258,6 @@ alters the view of @toolbar to display either icons only, text only, or both.
@style: the new style for @toolbar.
<!-- ##### FUNCTION gtk_toolbar_set_space_size ##### -->
<para>
should be used to set the number of pixels each item of space takes up in a toolbar.
</para>
@toolbar: a #GtkToolbar.
@space_size: the new number of pixels that spaces should consume.
<!-- ##### FUNCTION gtk_toolbar_set_space_style ##### -->
<para>
sets whether a 'space' in the toolbar appears as a line or just plain empty space.
</para>
@toolbar: a #GtkToolbar.
@space_style: the new style for the toolbar's spaces.
<!-- ##### FUNCTION gtk_toolbar_set_tooltips ##### -->
<para>
sets if the tooltips of a toolbar should be active or not.
......@@ -285,24 +267,6 @@ sets if the tooltips of a toolbar should be active or not.
@enable: set to 0 to disable the tooltips, or 1 to enable them.
<!-- ##### FUNCTION gtk_toolbar_set_button_relief ##### -->
<para>
</para>
@toolbar:
@relief:
<!-- ##### FUNCTION gtk_toolbar_get_button_relief ##### -->
<para>
</para>
@toolbar:
@Returns:
<!-- ##### FUNCTION gtk_toolbar_insert_stock ##### -->
<para>
......@@ -355,18 +319,3 @@ should be used if you wish to perform an action when ever the style of a toolbar
</para>
<!-- ##### ARG GtkToolbar:space-size ##### -->
<para>
</para>
<!-- ##### ARG GtkToolbar:space-style ##### -->
<para>
</para>
<!-- ##### ARG GtkToolbar:relief ##### -->
<para>
</para>
......@@ -1903,8 +1903,8 @@ static struct
const char *xsettings_name;
const char *gdk_name;
} settings_map[] = {
{ "Net/DoubleClickTime", "double-click-timeout" },
{ "Net/DragThreshold", "drag-threshold" }
{ "Net/DoubleClickTime", "gtk-double-click-timeout" },
{ "Net/DragThreshold", "gtk-drag-threshold" }
};
static void
......
......@@ -25,17 +25,16 @@
*/
#include "gtkbbox.h"
#include "gtkintl.h"
static void gtk_button_box_class_init (GtkButtonBoxClass *klass);
static void gtk_button_box_init (GtkButtonBox *box);
static gint default_child_min_width = 85;
static gint default_child_min_height = 27;
static gint default_child_ipad_x = 7;
static gint default_child_ipad_y = 0;
#define DEFAULT_CHILD_MIN_WIDTH 85
#define DEFAULT_CHILD_MIN_HEIGHT 27
#define DEFAULT_CHILD_IPAD_X 7
#define DEFAULT_CHILD_IPAD_Y 0
GtkType
gtk_button_box_get_type (void)
......@@ -72,6 +71,42 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
/* FIXME we need to override the "spacing" property on GtkBox once
* libgobject allows that.
*/
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("child_min_width",
_("Minimum child width"),
_("Minimum width of buttons inside the box"),
0,
G_MAXINT,
DEFAULT_CHILD_MIN_WIDTH,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("child_min_height",
_("Minimum child height"),
_("Minimum height of buttons inside the box"),
0,
G_MAXINT,
DEFAULT_CHILD_MIN_HEIGHT,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("child_internal_pad_x",
_("Child internal width padding"),
_("Amount to increase child's size on either side"),
0,
G_MAXINT,
DEFAULT_CHILD_IPAD_X,
G_PARAM_READABLE));
gtk_widget_class_install_style_property (widget_class,
g_param_spec_int ("child_internal_pad_y",
_("Child internal height padding"),
_("Amount to increase child's size on the top and bottom"),
0,
G_MAXINT,
DEFAULT_CHILD_IPAD_Y,
G_PARAM_READABLE));
}
static void
......@@ -166,10 +201,15 @@ _gtk_button_box_child_requisition (GtkWidget *widget,
bbox = GTK_BUTTON_BOX (widget);
width_default = default_child_min_width;
height_default = default_child_min_height;
ipad_x_default = default_child_ipad_x;
ipad_y_default = default_child_ipad_y;
gtk_widget_style_get (widget,
"child_min_width",
&width_default,
"child_min_height",
&height_default,
"child_internal_pad_x",
&ipad_x_default,
"child_internal_pad_y",
&ipad_y_default, NULL);
child_min_width = bbox->child_min_width != GTK_BUTTONBOX_DEFAULT
? bbox->child_min_width : width_default;
......
......@@ -376,10 +376,10 @@ gtk_button_new_from_stock (const gchar *stock_id)
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);
hbox = gtk_hbox_new (FALSE, 1);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 2);
gtk_box_pack_end (GTK_BOX (hbox), label, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER (button), hbox);
gtk_widget_show_all (hbox);
......
......@@ -500,7 +500,7 @@ gtk_combo_popup_button_press (GtkWidget *button,
gtk_widget_grab_focus (combo->entry);
if (event->button != 1)
return;
return FALSE;
combo->current_button = event->button;
......
......@@ -1694,43 +1694,6 @@ gtk_entry_style_set (GtkWidget *widget,
}
}
static char *
strstr_len (const char *haystack,
int haystack_len,
const char *needle)
{
int i;
g_return_val_if_fail (haystack != NULL, NULL);
g_return_val_if_fail (needle != NULL, NULL);
if (haystack_len < 0)
return strstr (haystack, needle);
else
{
const char *p = haystack;
int needle_len = strlen (needle);
const char *end = haystack + haystack_len - needle_len;
if (needle_len == 0)
return (char *)haystack;
while (*p && p <= end)
{
for (i = 0; i < needle_len; i++)
if (p[i] != needle[i])
goto next;
return (char *)p;
next:
p++;
}
}
return NULL;
}
/* Default signal handlers
*/
static void
......@@ -1741,26 +1704,10 @@ gtk_entry_real_insert_text (GtkEntry *entry,
{
gint index;
gint n_chars;
gchar line_separator[7];
gint len;
gchar *p;
if (new_text_length < 0)
new_text_length = strlen (new_text);
/* We don't want to allow inserting paragraph delimeters
*/
pango_find_paragraph_boundary (new_text, new_text_length, &new_text_length, NULL);
/* Or line separators - this is really painful
*/
len = g_unichar_to_utf8 (0x2028, line_separator); /* 0x2028 == LS */
line_separator[len] = '\0';
p = strstr_len (new_text, new_text_length, line_separator);
if (p)
new_text_length = p - new_text;
n_chars = g_utf8_strlen (new_text, new_text_length);
if (entry->text_max_length > 0 && n_chars + entry->text_length > entry->text_max_length)
{
......@@ -2167,6 +2114,8 @@ gtk_entry_create_layout (GtkEntry *entry,
gint preedit_length = 0;
PangoAttrList *preedit_attrs = NULL;
pango_layout_set_single_paragraph_mode (layout, TRUE);
if (include_preedit)
{
gtk_im_context_get_preedit_string (entry->im_context,
......
......@@ -36,6 +36,7 @@
#include "gtkwindow.h"
#include "gtkhbox.h"
#include "gtkvscrollbar.h"
#include "gtksettings.h"
#define MENU_ITEM_CLASS(w) GTK_MENU_ITEM_GET_CLASS (w)
......@@ -1372,19 +1373,54 @@ gtk_menu_key_press (GtkWidget *widget,
GdkEventKey *event)
{
GtkMenuShell *menu_shell;
GtkMenu *menu;
gboolean delete = FALSE;
gchar *accel = NULL;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (GTK_IS_MENU (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
menu_shell = GTK_MENU_SHELL (widget);
gtk_menu_stop_navigating_submenu (GTK_MENU (widget));
menu = GTK_MENU (widget);
gtk_menu_stop_navigating_submenu (menu);
if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
return TRUE;
g_object_get (G_OBJECT (gtk_settings_get_global ()),
"gtk-menu-bar-accel",
&accel,
NULL);
if (accel)
{
guint keyval = 0;
GdkModifierType mods = 0;
gboolean handled = FALSE;
gtk_accelerator_parse (accel, &keyval, &mods);
if (keyval == 0)
g_warning ("Failed to parse menu bar accelerator '%s'\n", accel);
/* FIXME this is wrong, needs to be in the global accel resolution
* thing, to properly consider i18n etc., but that probably requires
* AccelGroup changes etc.
*/
if (event->keyval == keyval &&
(mods & event->state) == mods)
{
gtk_signal_emit_by_name (GTK_OBJECT (menu), "cancel");
}
g_free (accel);
if (handled)
return TRUE;
}
switch (event->keyval)
{
case GDK_Delete:
......
......@@ -29,6 +29,10 @@
#include "gtkmain.h"
#include "gtkmenubar.h"
#include "gtkmenuitem.h"
#include "gtksettings.h"
#include "gtkintl.h"
#include "gtkwindow.h"
#include "gtksignal.h"
enum {
ARG_0,
......@@ -41,13 +45,6 @@ enum {
static void gtk_menu_bar_class_init (GtkMenuBarClass *klass);
static void gtk_menu_bar_init (GtkMenuBar *menu_bar);
static void gtk_menu_bar_set_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_menu_bar_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
static void gtk_menu_bar_size_request (GtkWidget *widget,
GtkRequisition *requisition);
static void gtk_menu_bar_size_allocate (GtkWidget *widget,
......@@ -56,7 +53,8 @@ static void gtk_menu_bar_paint (GtkWidget *widget,
GdkRectangle *area);
static gint gtk_menu_bar_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_menu_bar_hierarchy_changed (GtkWidget *widget);
static GtkShadowType get_shadow_type (GtkMenuBar *menubar);
static GtkMenuShellClass *parent_class = NULL;
......@@ -73,7 +71,7 @@ gtk_menu_bar_get_type (void)
sizeof (GtkMenuBar),
sizeof (GtkMenuBarClass),
(GtkClassInitFunc) gtk_menu_bar_class_init,
(GtkObjectInitFunc) gtk_menu_bar_init,
(GtkObjectInitFunc) NULL,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
......@@ -100,15 +98,11 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
widget_class = (GtkWidgetClass*) class;
menu_shell_class = (GtkMenuShellClass*) class;
gtk_object_add_arg_type ("GtkMenuBar::shadow", GTK_TYPE_SHADOW_TYPE, GTK_ARG_READWRITE, ARG_SHADOW);
object_class->set_arg = gtk_menu_bar_set_arg;
object_class->get_arg = gtk_menu_bar_get_arg;
widget_class->size_request = gtk_menu_bar_size_request;
widget_class->size_allocate = gtk_menu_bar_size_allocate;
widget_class->expose_event = gtk_menu_bar_expose;
widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed;
menu_shell_class->submenu_placement = GTK_TOP_BOTTOM;
binding_set = gtk_binding_set_by_class (class);
......@@ -132,51 +126,21 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
"move_current", 1,
GTK_TYPE_MENU_DIRECTION_TYPE,
GTK_MENU_DIR_CHILD);