The right click Header menu at the header is a C menu. I want to display the content in a Python menu. Like the View menu of the Text editor.
I can grab the operator, create my own class to execute it. And that way i can display the Flip to Top button. And it is fully functional. But how do i display the Collapse Menus prop with its checkbox? layout.operator is functional, but doesn't display the checkbox state. And layout.prop gives errors since i execute an operator, and don't have a prop involved here yet.
My problem is how the things needs to be connected, how the prop should look like. I cannot create a new prop here, it already exists. Or am i at the wrong track here? Maybe there is a direct way to grab this prop? As told it's a C menu, not Python.
The vital code parts are also marked green in the following screenshot:
class VIEW3D_MT_testheaderflip(bpy.types.Operator):
"""tooltip"""
bl_idname = "view3d.headerflip"
bl_label = "header flip"
bl_options = {'REGISTER', 'UNDO'}
def execute(self, context): # execute()
bpy.ops.screen.header_flip()
return {'FINISHED'}
...
layout.operator("view3d.headerflip", text="headerflip")