Modal script : hide tool bar

Hello,
I’m doing a modal script and I’d like it behave like the grab/scale/rotate tool : how to hide current toolbar and replace it by the shortcuts of the active modal and some other information.

http://s27.postimg.org/4k1obku5f/modal.gif

Thanks :slight_smile:

Here is the script structure I have for the moment for the modal operator:

def modal(self, context, event):
    
    w = context.window_manager.windows[0]
    w.cursor_modal_set("CROSSHAIR")
    

    if event.type == "MOUSEMOVE":
        fctA()
    
    elif event.type == "WHEELUPMOUSE":
        fctB()
    
    elif event.type == "WHEELDOWNMOUSE":
        fctC()
    
    elif event.type in ("LEFTMOUSE", "RET", "NUMPAD_ENTER"):
        
        w.cursor_modal_restore()
        return {'FINISHED'}
    
    
    elif event.type in ("RIGHTMOUSE", "ESC"):
        w.cursor_modal_restore()
        
        return {'CANCELLED'}

The built-in, interactive status bar is hard-coded. But you could write a Python script to achieve something similar. What you need is context.area.header_text_set(“text ges here”) and header_text_set() to clear / return to normal toolbar.

Thank you again CoDEmanX! you always have the solution! :slight_smile: