2.7x python UI: know the state of Tab (active or inactive)?

Hi,
It is now possible to change the color of an active or inactive Tab from the user> theme preferences. My python code, I wish to know the status (active or inactive) of a Tab, is this possible and how?
Why do I want this? I want to automatically disable current actions when I change tab.
Thank you