I was working with the addon but I have stuck at this situation. I want to press the Next button inside panel then, new operators should pop up and the rest operators should be removed. Basically, I want to know how does Next button work.
There is a better example in the screenshots to understand what I am looking for.
import bpy
C = bpy.context
D = bpy.data
O = bpy.ops
class ADDON_PANEL(bpy.types.Panel):
bl_label = "Add Objects"
bl_idname = "pl.add_mesh"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Add Objects"
def draw(self,context):
layout = self.layout
layout.operator('meshes.delete_all')
row=layout.row(align=True)
row.operator('back.op')
row.operator('next.op')
layout.operator('mesh.add_cube')
class NEXT_OP(bpy.types.Operator):
bl_label = "Next"
bl_idname = "next.op"
def execute(self, context):
return {'FINISHED'}
class BACK_OP(bpy.types.Operator):
bl_label = "Back"
bl_idname = "back.op"
def execute(self, context):
return {'FINISHED'}
class ADD_OBJECTS(bpy.types.Operator):
bl_label = "Add Cube"
bl_idname = "mesh.add_cube"
def execute(self, context):
O.mesh.primitive_cube_add()
C.object.modifiers.new('Subdividion','SUBSURF')
return {'FINISHED'}
class DELETE_ALL(bpy.types.Operator):
bl_label = "Delete all objects"
bl_idname = "meshes.delete_all"
def execute(self, context):
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False, confirm=False)
return {'FINISHED'}
classes = (ADDON_PANEL, DELETE_ALL, NEXT_OP, BACK_OP, ADD_OBJECTS)
def register():
for cls in classes:
bpy.utils.register_class(cls)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
if name == "main":
register()
```


