Python Question about creating custom menus

I would like to preface this by saying that I know barely anything about coding. So I’m following this tutorial about creating custom menus in blender (because I’m too impatient to wait for 2.8) and so far it’s working, however when I try to add an operator with options (in my case object.origin.set for the set origin menu), it won’t show up in the menu and the tutorial only shows how to add operators without options.

Here’s a screenshot of the current code:

When I run the script, the set origin option either doesn’t do anything, because the parantheses are empty/not defied and nothing happens (see last line in the command bar), or it doesn’t show up in the menu at all if I do fill in the parantheses (e.g. using “object.origin_set(type=‘GEOMETRY_ORIGIN’”))

What I would like is for the menu to show up with options, so I can click and select the type I want or with a dropdown menu or something. Is this possible and if so, how can it be done?

See if this is what you’re wanting.

layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'

If you want all origin options, you can do this. This will give all options in a menu.

layout.operator_menu_enum("object.origin_set", "type", text="Set Origin")

if you want multiple options for the operator, you do something like this.

GEO_ORIG = layout.operator("object.origin_set", text="Geometry to Origin")
GEO_ORIG.type = 'GEOMETRY_ORIGIN'
GEO_ORIG.center = 'BOUNDS'

Thank you, the layout.operator_menu_enum command worked.