1. David Vasconcelos
  2. PowerBuilder
  3. Tuesday, 12 February 2019 19:41 PM UTC

Haven't worked with menus to often so I hope this is just something easy and I am just not seeing the forest through the trees.  I create a generic menu variable then assign a menu to it. Then I need to access the menu items.  Because I created the menu variable using the generic menu type it does not recognize any menu items under it.  So how do I access those items?  Below is the scenario


Instance Variable for the menu
Menu ImPopmenu
imPopmenu = Create menu
imPopmenu = m_popmenu

//m_popmenu has two items In it...
m_popmenu
       m_name

       m_something

if I code...  imPopmenu.m_name......  it gives me an error that it does not recognize m_name.

 

IF I created the variable like this it does work (basically Fully qualifying the menu)

m_popmenu imPopmenu

imPopmenu = Create m_popmenu

 

Tried to use "Dynamic" but that does not work either..

Dave V

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 12 February 2019 20:43 PM UTC
  2. PowerBuilder
  3. # 1

Hi David;

  To instantiate a menu dynamically and then "Pop" it up, for example ...

mu_popup_master  lo_mu
String           ls_pop_menu
Int              li_x, li_y                                                                            
ls_pop_menu = is_pop_menu  +  "_" + go_ac.of_get_Language ( )
lo_wn = THIS.of_Get_Parent_Window ()
lo_mu =    CREATE   using ls_pop_menu
li_X = lo_wn.PointerX ()
li_Y = lo_wn.PointerY ()
lo_mu.mi_object.PopMenu (li_X, li_Y)

 

HTH

Regards .. Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.