Article View: comp.windows.interviews
Article #1299Re: Adding menuitem after window is mapped
From: Doron Shalmon
Date: Fri, 20 Nov 1992 20:06
Date: Fri, 20 Nov 1992 20:06
32 lines
2190 bytes
2190 bytes
In article <1992Nov20.060140.5973@walter.bellcore.com> doron@leis.bellcore.com (Doron Shalmon) writes:
>I'm trying to add MenuItems to a Menu dynamically after
>the window with the menubar has already been mapped.
>However, the new items do not appear when I pull down
>the menu. I know that the items are appended properly,
>because I can drag down below the bottom of the menu
>to where the new item should be, and it does execute
>the invisible item's action. How can I get the added
>menu items to appear the next time the menu is pulled
>down??
After further experimentation, it turns out that the problem
is not with adding items after the enclosing window is mapped,
but with adding items after the pulldown menu has been opened
already. It seems that this is because the pulldown menu's
PopupWindow only computes its geometry the first time it
is mapped. Do I need to unbind the menu's PopupWindow
after adding new menu items, so that the next time it is
mapped it will recompute its geometry? Is this safe?
-- Doron
===========================================================================
Doron Shalmon Internet doron@yogi.leis.bellcore.com
444 Hoes Lane (RRC 4B-1125) CompuServe 72330,3307
Piscataway, NJ 08854 VOICE (908) 699-8133
FAX (908) 336-2982
_ _ _ _ _ _
|_> |_ | | | | | |_> |_ "All opinions expressed are mine, and do not
|_> |_ |_ |_ |_ |_| | \ |_ necessarily represent those of my employer,
Bell Communications Research (Bellcore)"
Bell Communications Research
Technical Details
Message-ID:
<1992Nov20.200622.21909@walter.bellcore.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!wupost!cs.utexas.edu!sun-barr!ames!pacbell.com!att-out!walter!corral!doronReferences:
<1992Nov20.060140.5973@walter.bellcore.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews Path: arc1-ca.pugleaf.net!sparky!uunet!wupost!cs.utexas.edu!sun-barr!ames!pacbell.com!att-out!walter!corral!doron From: doron@corral.bellcore.com (Doron Shalmon) Subject: Re: Adding menuitem after window is mapped Message-ID: <1992Nov20.200622.21909@walter.bellcore.com> Followup-To: comp.windows.interviews Sender: news@walter.bellcore.com Nntp-Posting-Host: 128.96.148.248 Organization: Bellcore References: <1992Nov20.060140.5973@walter.bellcore.com> Date: Fri, 20 Nov 92 20:06:22 GMT Lines: 32