comparison src/w32menu.c @ 55671:6817f9469688

(add_menu_item, w32_menu_display_help) [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member.
author Jason Rumney <jasonr@gnu.org>
date Tue, 18 May 2004 19:53:08 +0000
parents fe8e63ae41d9
children 1fa5ffcb2ac8 4c90ffeb71c5
comparison
equal deleted inserted replaced
55670:d3274c878082 55671:6817f9469688
2223 info.fMask = MIIM_DATA; 2223 info.fMask = MIIM_DATA;
2224 2224
2225 /* Set help string for menu item. Leave it as a Lisp_Object 2225 /* Set help string for menu item. Leave it as a Lisp_Object
2226 until it is ready to be displayed, since GC can happen while 2226 until it is ready to be displayed, since GC can happen while
2227 menus are active. */ 2227 menus are active. */
2228 if (wv->help) 2228 if (!NILP (wv->help))
2229 info.dwItemData = (DWORD) wv->help; 2229 #ifdef USE_LISP_UNION_TYPE
2230 2230 info.dwItemData = (DWORD) (wv->help).i;
2231 #else
2232 info.dwItemData = (DWORD) (wv->help);
2233 #endif
2231 if (wv->button_type == BUTTON_TYPE_RADIO) 2234 if (wv->button_type == BUTTON_TYPE_RADIO)
2232 { 2235 {
2233 /* CheckMenuRadioItem allows us to differentiate TOGGLE and 2236 /* CheckMenuRadioItem allows us to differentiate TOGGLE and
2234 RADIO items, but is not available on NT 3.51 and earlier. */ 2237 RADIO items, but is not available on NT 3.51 and earlier. */
2235 info.fMask |= MIIM_TYPE | MIIM_STATE; 2238 info.fMask |= MIIM_TYPE | MIIM_STATE;
2305 bzero (&info, sizeof (info)); 2308 bzero (&info, sizeof (info));
2306 info.cbSize = sizeof (info); 2309 info.cbSize = sizeof (info);
2307 info.fMask = MIIM_DATA; 2310 info.fMask = MIIM_DATA;
2308 get_menu_item_info (menu, item, FALSE, &info); 2311 get_menu_item_info (menu, item, FALSE, &info);
2309 2312
2313 #ifdef USE_LISP_UNION_TYPE
2314 help = info.dwItemData ? (Lisp_Object) ((EMACS_INT) info.dwItemData)
2315 : Qnil;
2316 #else
2310 help = info.dwItemData ? (Lisp_Object) info.dwItemData : Qnil; 2317 help = info.dwItemData ? (Lisp_Object) info.dwItemData : Qnil;
2318 #endif
2311 } 2319 }
2312 2320
2313 /* Store the help echo in the keyboard buffer as the X toolkit 2321 /* Store the help echo in the keyboard buffer as the X toolkit
2314 version does, rather than directly showing it. This seems to 2322 version does, rather than directly showing it. This seems to
2315 solve the GC problems that were present when we based the 2323 solve the GC problems that were present when we based the