正式员工
- UID
- 47135
- 积分
- 514
- 金币
-
- 活跃
-
- 阅读权限
- 50
- 注册时间
- 2008-10-25
- 最后登录
- 1970-1-1
|
- import kcs_gui
- import kcs_util
- def post(*args):
- if kcs_util.app_drafting():
- try:
- main_menu = kcs_gui.menu_get(None,0)
- except:
- print "Failed retrieving main menu: ",kcs_gui.error
- try:
- file_menu = kcs_gui.menu_get(main_menu,0)
- except:
- print "Failed retrieving file menu: ",kcs_gui.error
- try:
- item = kcs_gui.menu_item_get(file_menu,0)
- kcs_gui.menu_item_set(file_menu,0,"My New",item[1])
- except:
- print "Failed changing menu item: ",kcs_gui.error
- try:
- kcs_gui.menu_remove(main_menu,9)
- kcs_gui.menu_remove(main_menu,8)
- except:
- print "Failed removing menus: ",kcs_gui.error
- try:
- my_menu = kcs_gui.menu_add(main_menu,8,"&My Menu")
- except:
- print "Failed adding menu: ",kcs_gui.error
- try:
- kcs_gui.menu_item_std_add(my_menu,0,"&Open Volume...",33148)
- kcs_gui.menu_item_std_add(my_menu,1,"&New Volume...",33149)
- kcs_gui.menu_item_std_add(my_menu,2,"",-1)
- kcs_gui.menu_item_usr_add(my_menu,3,"My command &1","command1")
- kcs_gui.menu_item_usr_add(my_menu,4,"My command &2","command2")
- except:
- print "Failed adding menu items: ",kcs_gui.error
- return kcs_util.trigger_ok()
- def pre(*args):
- return kcs_util.trigger_ok()
复制代码 我把它命名为trig_draft_init.py,并删掉原PYC文件,重启TB后,却为什么没有达到效果呢?
SBB_TRIGDIR是指向VITTESE\TRIGGER文件夹下的,SB_PYTHON也是指向VITTESE下的:
SBB_TRIGDIR=C:\Tribon\M3\Vitesse\Trigger
SB_PYTHON=C:\Tribon\M3\vitesse
这个没错吧,
为什么加不上去菜单的,我好焦急啊
写好的程序没法测试了~~~
请高人帮忙指教啊!!!
[ 本帖最后由 everdmind 于 2009-1-11 14:13 编辑 ] |
|