[gcalctool] Fixes to work with latest GTK3
- From: Robin Sonefors <rsonefors src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gcalctool] Fixes to work with latest GTK3
- Date: Sat, 2 Oct 2010 18:19:07 +0000 (UTC)
commit 7dee782304cf5c5bc3e113cdfa2cb4d3bff446b6
Author: William Jon McCann <jmccann redhat com>
Date: Sat Oct 2 02:42:33 2010 -0400
Fixes to work with latest GTK3
https://bugzilla.gnome.org/show_bug.cgi?id=630115
src/math-buttons.c | 2 +-
src/math-display.c | 72 ++++++++++++++++++++++++------------------------
src/math-preferences.c | 1 -
src/math-window.c | 8 ++--
4 files changed, 41 insertions(+), 42 deletions(-)
---
diff --git a/src/math-buttons.c b/src/math-buttons.c
index 802c290..81b3057 100644
--- a/src/math-buttons.c
+++ b/src/math-buttons.c
@@ -335,7 +335,7 @@ set_tint (GtkWidget *widget, GdkColor *tint, gint alpha)
color.red = (style->bg[j].red * (10 - alpha) + tint->red * alpha) / 10;
color.green = (style->bg[j].green * (10 - alpha) + tint->green * alpha) / 10;
color.blue = (style->bg[j].blue * (10 - alpha) + tint->blue * alpha) / 10;
- gdk_colormap_alloc_color(gdk_colormap_get_system(), &color, FALSE, TRUE);
+
gtk_widget_modify_bg(widget, j, &color);
}
}
diff --git a/src/math-display.c b/src/math-display.c
index 62f0218..9343cc3 100644
--- a/src/math-display.c
+++ b/src/math-display.c
@@ -74,15 +74,15 @@ display_key_press_cb(GtkWidget *widget, GdkEventKey *event, MathDisplay *display
c = gdk_keyval_to_unicode(event->keyval);
/* Solve on enter */
- if (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) {
+ if (event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter) {
math_equation_solve(display->priv->equation);
return TRUE;
}
/* Clear on escape */
- if ((event->keyval == GDK_Escape && state == 0) ||
- (event->keyval == GDK_BackSpace && state == GDK_CONTROL_MASK) ||
- (event->keyval == GDK_Delete && state == GDK_SHIFT_MASK)) {
+ if ((event->keyval == GDK_KEY_Escape && state == 0) ||
+ (event->keyval == GDK_KEY_BackSpace && state == GDK_CONTROL_MASK) ||
+ (event->keyval == GDK_KEY_Delete && state == GDK_SHIFT_MASK)) {
math_equation_clear(display->priv->equation);
return TRUE;
}
@@ -107,34 +107,34 @@ display_key_press_cb(GtkWidget *widget, GdkEventKey *event, MathDisplay *display
if (state == GDK_CONTROL_MASK) {
switch(event->keyval)
{
- case GDK_bracketleft:
+ case GDK_KEY_bracketleft:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_bracketright:
+ case GDK_KEY_bracketright:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_e:
+ case GDK_KEY_e:
math_equation_insert_exponent(display->priv->equation);
return TRUE;
- case GDK_f:
+ case GDK_KEY_f:
math_equation_factorize(display->priv->equation);
return TRUE;
- case GDK_i:
+ case GDK_KEY_i:
math_equation_insert(display->priv->equation, "�¹");
return TRUE;
- case GDK_p:
+ case GDK_KEY_p:
math_equation_insert(display->priv->equation, "Ï?");
return TRUE;
- case GDK_r:
+ case GDK_KEY_r:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_u:
+ case GDK_KEY_u:
math_equation_insert(display->priv->equation, "µ");
return TRUE;
- case GDK_minus:
+ case GDK_KEY_minus:
math_equation_insert(display->priv->equation, "â?»");
return TRUE;
- case GDK_apostrophe:
+ case GDK_KEY_apostrophe:
math_equation_insert(display->priv->equation, "°");
return TRUE;
}
@@ -142,10 +142,10 @@ display_key_press_cb(GtkWidget *widget, GdkEventKey *event, MathDisplay *display
if (state == GDK_MOD1_MASK) {
switch(event->keyval)
{
- case GDK_bracketleft:
+ case GDK_KEY_bracketleft:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_bracketright:
+ case GDK_KEY_bracketright:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
}
@@ -154,34 +154,34 @@ display_key_press_cb(GtkWidget *widget, GdkEventKey *event, MathDisplay *display
if (state == GDK_CONTROL_MASK || math_equation_get_number_mode(display->priv->equation) == SUPERSCRIPT) {
switch(event->keyval)
{
- case GDK_0:
+ case GDK_KEY_0:
math_equation_insert(display->priv->equation, "â?°");
return TRUE;
- case GDK_1:
+ case GDK_KEY_1:
math_equation_insert(display->priv->equation, "¹");
return TRUE;
- case GDK_2:
+ case GDK_KEY_2:
math_equation_insert(display->priv->equation, "²");
return TRUE;
- case GDK_3:
+ case GDK_KEY_3:
math_equation_insert(display->priv->equation, "³");
return TRUE;
- case GDK_4:
+ case GDK_KEY_4:
math_equation_insert(display->priv->equation, "â?´");
return TRUE;
- case GDK_5:
+ case GDK_KEY_5:
math_equation_insert(display->priv->equation, "â?µ");
return TRUE;
- case GDK_6:
+ case GDK_KEY_6:
math_equation_insert(display->priv->equation, "â?¶");
return TRUE;
- case GDK_7:
+ case GDK_KEY_7:
math_equation_insert(display->priv->equation, "â?·");
return TRUE;
- case GDK_8:
+ case GDK_KEY_8:
math_equation_insert(display->priv->equation, "â?¸");
return TRUE;
- case GDK_9:
+ case GDK_KEY_9:
math_equation_insert(display->priv->equation, "â?¹");
return TRUE;
}
@@ -189,34 +189,34 @@ display_key_press_cb(GtkWidget *widget, GdkEventKey *event, MathDisplay *display
else if (state == GDK_MOD1_MASK || math_equation_get_number_mode(display->priv->equation) == SUBSCRIPT) {
switch(event->keyval)
{
- case GDK_0:
+ case GDK_KEY_0:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_1:
+ case GDK_KEY_1:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_2:
+ case GDK_KEY_2:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_3:
+ case GDK_KEY_3:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_4:
+ case GDK_KEY_4:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_5:
+ case GDK_KEY_5:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_6:
+ case GDK_KEY_6:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_7:
+ case GDK_KEY_7:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_8:
+ case GDK_KEY_8:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
- case GDK_9:
+ case GDK_KEY_9:
math_equation_insert(display->priv->equation, "â??");
return TRUE;
}
diff --git a/src/math-preferences.c b/src/math-preferences.c
index c846523..d2a3c58 100644
--- a/src/math-preferences.c
+++ b/src/math-preferences.c
@@ -239,7 +239,6 @@ create_gui(MathPreferencesDialog *dialog)
_("Preferences"));
gtk_window_set_icon_name(GTK_WINDOW(dialog), "accessories-calculator");
gtk_container_set_border_width(GTK_CONTAINER(dialog), 8);
- gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
gtk_dialog_add_button(GTK_DIALOG(dialog),
/* Label on close button in preferences dialog */
_("_Close"), 0);
diff --git a/src/math-window.c b/src/math-window.c
index 0daf030..14c32fd 100644
--- a/src/math-window.c
+++ b/src/math-window.c
@@ -372,14 +372,14 @@ 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);
@@ -393,7 +393,7 @@ 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]