In a message dated 5/25/98 2:30:29 PM, rush@... wrote: >Can any one supply me with a functioning popup menu example? > >I would like to be able to grey out the selected item and print the >choice on the screen but remove the menu from view. I don't have a working example but here is how you might do it: First draw the popup in the window with a function that does something like this: '========================================= LOCAL FN drawPopUp (popupID%, myItem%, L,T,R,B) DIM rect; 8 '--------------------------------------- ' draws the popup menus '--------------------------------------- CALL SETRECT(rect, L, T, R, B) DEF SHADOWBOX(rect) 'popup shadow box DEF SHOWPOP (rect) 'show popup arrow CALL GETITEM(FN GETMENU(popupID%),myItem%, popUpTxt$) CALL SETRECT (rect, L+1, T+1, R-20, B-3) 'room for text EDIT FIELD # popupID%, popUpTxt$, @rect, _statNoFramed END FN Then use the next function to draw the popped menu, when selected, and get the selected item '========================================= CLEAR LOCAL MODE 'use in your programs to select popups DIM rect.8 DIM invRect.8 'menu pos rect, invert title rect DIM menuResult&;0, menuID,itemID 'results go to menuID and itemID DIM popUpTxt$, mH& '--------------------------------------- ' draws the popup and selects the item '--------------------------------------- LOCAL FN popUpMenu (popupID, popItem, L,T,R,B) CALL SETRECT(invRect,L,T,R,B) 'set invert area CALL SETRECT(rect,L,T,R- 20,B) CALL INVERTRECT(invRect) 'invert title when menu up CALL LOCALTOGLOBAL(rect) 'convert rect to global (screen) mH& = FN GETMENU(popupID) CALL INSERTMENU (mH&, -1) menuResult&=FN POPUPMENUSELECT(mH&, rect.top%, rect.left%,popItem) CALL GLOBALTOLOCAL(rect) 'set rect back to local (window) CALL INVERTRECT(invRect) 'un-invert popup menu CALL GETITEM(mH&,itemID, popUpTxt$) 'item text in menu CALL DELETEMENU (mH&) LONG IF menuResult& EDIT$(popupID) = popUpTxt$ XELSE itemID = popItem END IF END FN = itemID 'returns the itemID '========================================= Call it something like this: '=========================================== LOCAL FN selectPop (popUpId%, myItem%, L,T,R,B) DIM inRect;8 '--------------------------------------- ' gets the selection from a popup '--------------------------------------- CALL GETMOUSE(gThePoint&) CALL SETRECT(inRect, L+3, T+3, R-3, B-3) 'pop-up selection rect LONG IF FN PTINRECT (gThePoint&, gDstRect) myItem% = FN popUpMenu (popUpId%, myItem%, L, T, R, B) END IF END FN = myItem% '===================================== You can then get the item text and disable the item with something like these: LOCAL FN disablePop$ (popUpId%, myItem%) DIM mH&, popUpTxt$ '---------------------- 'disable a popup menu item and get text '----------------------- mH& = FN GETMENU(popUpId%) LONG IF mH& CALL GETITEM(mH&,myItem%, popUpTxt$) 'item text in menu CALL DISABLEITEM ( mH&, myItem%) CALL DELETEMENU (mH&) END IF END FN = popUpTxt$ '===================================== I am sure there are easier ways than this but variations of this have worked for me. You will need to redraw the pop-up whenever there is a window refresh by doing something like this: '==================================== LOCAL FN drawPopUp (L,T,R,B) DIM rect; 8 '--------------------------------------- ' draws the popup menus as needed '--------------------------------------- CALL SETRECT(rect, L, T, R, B) DEF SHADOWBOX(rect) 'popup shadow box DEF SHOWPOP (rect) 'show popup arrow END FN '============================= I never have been able to pass a rect correctly between functions (I always pass l,t,r,b). Maybe someone can show me how this should be done. I'm not sure if the @rect is in the actual FN or in the call of the function (or both). All of this assumes that you have built the pop up in ResEdit beforehand (resource menus). HTH Mark