Page 1 of 1

GetMenuItemText and #pb_any doesnt work

Posted: Wed Jun 27, 2012 8:07 am
by max_aigneraigner@web.de
Hello forum,

the command getmenuitemtext does not work with #pb_any for the menuitem ID.
Here a code:

Code: Select all

CompilerIf #PB_Compiler_Debugger = 0
   MessageRequester( "ERROR" , "Enable Debugger!" , #MB_ICONINFORMATION )
   End 
CompilerEndIf 

OpenWindow        ( 0 , 0 , 0 , 200,200,"")
   CreateMenu     ( 0 , WindowID ( 0 ) )
      MenuItem    ( 0 , "hallo " )
      MenuItem    ( #PB_Any , "zusammen" )
      
Repeat 
   evt            = WaitWindowEvent ()
   
   Select         evt 
      Case        #PB_Event_Menu 
         eventmenu  = EventMenu () 
         Select eventmenu 
            
            Case    -1
            Default 
               Debug "ID: " + Str(eventmenu ) 
               Debug " text: " + GetMenuItemText( 0 , eventmenu )
               Debug ""
         EndSelect 
   EndSelect 
Until evt = #PB_Event_CloseWindow  
PB 4.60 windows 7 64

yours Max.

Re: GetMenuItemText and #pb_any doesnt work

Posted: Wed Jun 27, 2012 8:17 am
by c4s
No bug: You are not allowed to use #PB_Any for MenuItem(). Take a look into the help file! :P

Re: GetMenuItemText and #pb_any doesnt work

Posted: Wed Jun 27, 2012 8:24 am
by Ohnesorg
hm.. but it should hm.. :P As I do need it .. Now!. ^^
ok, delete that post (btw. it's still me, but I changed the account.. the old one included my email as Username.. not good)