comparison src/gui_gtk.c @ 944:b2dcb8457067 v7.0.070

updated for version 7.0-070
author vimboss
date Tue, 29 Aug 2006 15:30:07 +0000
parents a5677b7ce858
children a1c1f001b99d
comparison
equal deleted inserted replaced
943:e70aad5761b5 944:b2dcb8457067
955 #if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2) 955 #if defined(FEAT_TOOLBAR) && defined(HAVE_GTK2)
956 static int 956 static int
957 get_menu_position(vimmenu_T *menu) 957 get_menu_position(vimmenu_T *menu)
958 { 958 {
959 vimmenu_T *node; 959 vimmenu_T *node;
960 int index = 0; 960 int idx = 0;
961 961
962 for (node = menu->parent->children; node != menu; node = node->next) 962 for (node = menu->parent->children; node != menu; node = node->next)
963 { 963 {
964 g_return_val_if_fail(node != NULL, -1); 964 g_return_val_if_fail(node != NULL, -1);
965 ++index; 965 ++idx;
966 } 966 }
967 967
968 return index; 968 return idx;
969 } 969 }
970 #endif /* FEAT_TOOLBAR && HAVE_GTK2 */ 970 #endif /* FEAT_TOOLBAR && HAVE_GTK2 */
971 971
972 972
973 #if defined(FEAT_TOOLBAR) || defined(PROTO) 973 #if defined(FEAT_TOOLBAR) || defined(PROTO)
2125 { 2125 {
2126 char **ok; 2126 char **ok;
2127 char **ync; /* "yes no cancel" */ 2127 char **ync; /* "yes no cancel" */
2128 char **buttons; 2128 char **buttons;
2129 int n_buttons = 0; 2129 int n_buttons = 0;
2130 int index; 2130 int idx;
2131 2131
2132 button_string = vim_strsave(button_string); /* must be writable */ 2132 button_string = vim_strsave(button_string); /* must be writable */
2133 if (button_string == NULL) 2133 if (button_string == NULL)
2134 return; 2134 return;
2135 2135
2159 * Yes, the buttons are in reversed order to match the GNOME 2 desktop 2159 * Yes, the buttons are in reversed order to match the GNOME 2 desktop
2160 * environment. Don't hit me -- it's all about consistency. 2160 * environment. Don't hit me -- it's all about consistency.
2161 * Well, apparently somebody changed his mind: with GTK 2.2.4 it works the 2161 * Well, apparently somebody changed his mind: with GTK 2.2.4 it works the
2162 * other way around... 2162 * other way around...
2163 */ 2163 */
2164 for (index = 1; index <= n_buttons; ++index) 2164 for (idx = 1; idx <= n_buttons; ++idx)
2165 { 2165 {
2166 char *label; 2166 char *label;
2167 char_u *label8; 2167 char_u *label8;
2168 2168
2169 label = buttons[index - 1]; 2169 label = buttons[idx - 1];
2170 /* 2170 /*
2171 * Perform some guesswork to find appropriate stock items for the 2171 * Perform some guesswork to find appropriate stock items for the
2172 * buttons. We have to compare with a sample of the translated 2172 * buttons. We have to compare with a sample of the translated
2173 * button string to get things right. Yes, this is hackish :/ 2173 * button string to get things right. Yes, this is hackish :/
2174 * 2174 *
2186 else if (button_equal(label, "Yes")) label = GTK_STOCK_YES; 2186 else if (button_equal(label, "Yes")) label = GTK_STOCK_YES;
2187 else if (button_equal(label, "No")) label = GTK_STOCK_NO; 2187 else if (button_equal(label, "No")) label = GTK_STOCK_NO;
2188 else if (button_equal(label, "Cancel")) label = GTK_STOCK_CANCEL; 2188 else if (button_equal(label, "Cancel")) label = GTK_STOCK_CANCEL;
2189 } 2189 }
2190 label8 = CONVERT_TO_UTF8((char_u *)label); 2190 label8 = CONVERT_TO_UTF8((char_u *)label);
2191 gtk_dialog_add_button(dialog, (const gchar *)label8, index); 2191 gtk_dialog_add_button(dialog, (const gchar *)label8, idx);
2192 CONVERT_TO_UTF8_FREE(label8); 2192 CONVERT_TO_UTF8_FREE(label8);
2193 } 2193 }
2194 2194
2195 if (ok != NULL) 2195 if (ok != NULL)
2196 vim_free(*ok); 2196 vim_free(*ok);