2 levels menu with class how to ?

i look at the solid menu which is a 2 levels menu using the add mesh menu

but the second level is calling functions instead of class!

is there a way to call class like in pipe script or in a one level menu script
where for each class you control the buttons inside the class?

i built one script with a one level menu using addmesh but have too many options
i can regroup some and have a 2 level menus instead
but i did eveything with class including the buttons i need for each class

hope there is something that can use classes instead

thanks for any help