diff options
author | Perberos <[email protected]> | 2013-04-01 18:24:58 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2013-04-01 18:24:58 -0300 |
commit | 21ffe3cbc4250a14dc14c0d487f50d0a4fcd1543 (patch) | |
tree | 42cbf005461d0c0427f004fca59c0849a4f29439 /src | |
parent | e40b23add7bef94eb7fb381d3ed033dc847ed914 (diff) | |
download | mate-calc-21ffe3cbc4250a14dc14c0d487f50d0a4fcd1543.tar.bz2 mate-calc-21ffe3cbc4250a14dc14c0d487f50d0a4fcd1543.tar.xz |
GDK_* to GDK_KEY_* hack
Diffstat (limited to 'src')
-rw-r--r-- | src/math-window.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/math-window.c b/src/math-window.c index 164a457..e263f68 100644 --- a/src/math-window.c +++ b/src/math-window.c @@ -16,6 +16,21 @@ #include "math-window.h" #include "utility.h" +// gtk3 hack +#if !GLIB_CHECK_VERSION (3, 0, 0) + #ifndef GDK_KEY_F1 + #define GDK_KEY_F1 GDK_F1 + #endif + + #ifndef GDK_KEY_W + #define GDK_KEY_W GDK_w + #endif + + #ifndef GDK_KEY_Z + #define GDK_KEY_Z GDK_z + #endif +#endif + enum { PROP_0, PROP_EQUATION @@ -371,14 +386,14 @@ static void create_menu(MathWindow* window) add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_COPY, accel_group), G_CALLBACK(copy_cb), window); add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_PASTE, accel_group), G_CALLBACK(paste_cb), window); menu_item = add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_UNDO, accel_group), G_CALLBACK(undo_cb), window); - gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_z, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); + gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_KEY_Z, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); menu_item = add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_REDO, accel_group), G_CALLBACK(redo_cb), window); - gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_z, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); + gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_KEY_Z, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_ACCEL_VISIBLE); add_menu_item(menu, gtk_separator_menu_item_new(), NULL, NULL); add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_PREFERENCES, accel_group), G_CALLBACK(show_preferences_cb), window); add_menu_item(menu, gtk_separator_menu_item_new(), NULL, NULL); menu_item = add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, accel_group), G_CALLBACK(quit_cb), window); - gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_w, GDK_CONTROL_MASK, 0); + gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_KEY_W, GDK_CONTROL_MASK, 0); menu = add_menu(window->priv->menu_bar, MODE_MENU_LABEL); window->priv->mode_basic_menu_item = add_menu_item(menu, radio_menu_item_new(&group, MODE_BASIC_LABEL), G_CALLBACK(mode_changed_cb), window); @@ -392,7 +407,7 @@ static void create_menu(MathWindow* window) menu = add_menu(window->priv->menu_bar, HELP_MENU_LABEL); menu_item = add_menu_item(menu, gtk_menu_item_new_with_mnemonic(HELP_CONTENTS_LABEL), G_CALLBACK(help_cb), window); - gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_F1, 0, GTK_ACCEL_VISIBLE); + gtk_widget_add_accelerator(menu_item, "activate", accel_group, GDK_KEY_F1, 0, GTK_ACCEL_VISIBLE); add_menu_item(menu, gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, accel_group), G_CALLBACK(about_cb), window); } |