I am wondering if it is possible to convert a enum into an NUMBER and back again?
import uno
# ... other code
>>> bt = uno.Enum("com.sun.star.awt.PushButtonType", "OK")
>>> bt.value
'OK'
>>> btn.PushButtonType = bt
>>> btn.PushButtonType
1
>>> bt = uno.Enum("com.sun.star.awt.PushButtonType", "CANCEL")
>>> bt.value
'CANCEL'
>>> btn.PushButtonType = bt
>>> btn.PushButtonType
2
How could I get the the enum Name from the intereger
def get_push_button_type(enum_int: int) -> str:
# Return the enum name for Button Type; eg: "OK", "CANCEL", "STANDARD"
#What would have to go here?
pass