예제 #1
0
def menu_proc(id_menu,
              id_action,
              command="",
              caption="",
              index=-1,
              hotkey="",
              tag=""):
    if callable(command):
        sid_callback = str(command)
        _live[sid_callback] = command
        command = 'module={};func=_menu_proc_callback_proxy;info="{}";'.format(
            __name__, sid_callback)
    return ct.menu_proc(str(id_menu), id_action, to_str(command), caption,
                        index, hotkey, tag)
예제 #2
0
파일: cudatext.py 프로젝트: heX16/CudaText
def menu_proc(id_menu, id_action, command="", caption="", index=-1, hotkey="", tag=""):
    if callable(command):
        sid_callback = str(command)
        _live[sid_callback] = command
        command = 'module={};func=_menu_proc_callback_proxy;info="{}";'.format(__name__, sid_callback)
    return ct.menu_proc(str(id_menu), id_action, to_str(command), caption, index, hotkey, tag)