? Python access to View Type menu ?

I am trying to add a View Type switching menu to a custom menu. I can’t find any
way to access that menu via python. Is the view type menu in the headers
accessible only to C?

I also tried building a menu to switch view types using the operators
which appear in the info panel after changing a view type, but couldn’t
manage to get anything that worked.

Can anyone point me in the right direction?

you mean this one?

If i look in space_view3d.py I can find layout.template_header_3D which lays out the regular menus and buttons, but what creates this menu?:



Thanks CoDEmanX, that works, although it brings up a single entry which you then click on to get the full list as a sub-menu, so bound to a single hotkey means an extra click, but works ok in a menu list.

In a similar way I tried to get the Layout switcher into a custom menu using:

layout.template_ID(context.window, “screen”, new=“screen.new”, unlink=“screen.delete”)

which functions, but draws badly:

Is there any way to change the way this draws in a menu, or do I need to look at a custom popup?