Popup menu : caption missing

If I choose to create a menu item in code

dim t as new menuitem t.text = "Choices"

and then I add child menus

dim m as new menuitem m.text = "Choice 1" t.append m

When I display the menu as a popup

n = t.popup

The menu that is displayed is a text -less menu item with the disclosure arrow on the right. (click the arrow and “Choice 1” appears)
The word “Choices” does not appear

Is there any way to fix that?

Don’t get a blank menuitem here; instead I only see “Choice 1”.

But this code gives me what I think you’re looking for.

[code]Dim base as new menuitem

Dim m as new menuitem( “Choices” )
m.append new menuitem( “Choice 1” )
m.append new menuitem( “Choice 2” )
m.append new menuitem( “Choice 3” )

base.append m

m = base.popUp[/code]

Here’s how I would actually do something similar

[code]Dim m as new menuitem( “Choices” )
Dim options() as pair = array( “Choice 1” : 1, “Choice 2” : 2, “Choice 3” : 3 )
For each p as pair in options
m.append new menuitem( p.left, p.right )
Next

Dim base as new menuitem
base.append m

m = base.popUp

if m = nil then return
mSgBox m.tag[/code]

Hmm
That works… thank you.

My problem was I was changing the text of my ‘base’ instead of my ‘m’