Check my addon FCOStarveStop. Somewhere at the events (I think event_add_on_loaded) there is the code to register a new scene fragment for hud and/or hud_ui + the callback function for the OnStateChanged event, which shows/hides the toplevel control.
Hope it helps.
|