ini :
EMBED_TAB_NAME = pyvcp0
EMBED_TAB_COMMAND = first
PYVCP_TAB = /home/nkp/linuxcnc/configs/jog/j.xml
=============================
.axixrc :
def _dynamic_tabs(inifile):
from subprocess import Popen
import vcpparse
tab_names = inifile.findall("DISPLAY", "EMBED_TAB_NAME")
tab_cmd = inifile.findall("DISPLAY", "EMBED_TAB_COMMAND")
if len(tab_names) != len(tab_cmd):
print "Invalid tab configuration"
# Complain somehow
return
# XXX: Set our root window ID in environment so child GladeVcp processes
# may forward keyboard events to it
rxid = root_window.winfo_id()
os.environ = str(rxid)
for i,t,c in zip(range(len(tab_cmd)), tab_names, tab_cmd):
w = _dynamic_tab("user_" + str(i), t)
f = Tkinter.Frame(w, container=0, borderwidth=0, highlightthickness=0)
if inifile.find("DISPLAY", "PYVCP_TAB"):
f.pack(fill="y", expand=0)
fxml = inifile.findall("DISPLAY", "PYVCP_TAB")
for aa in fxml:
print "fxml=" ,aa
for tc in tab_cmd:
print "tab_cmd=" ,tc
vcpparse.filename = aa
vcpparse.create_vcp(f, comp = None, compname=tc)
else:
f.pack(fill="both", expand=1)
xid = f.winfo_id()
cmd = c.replace('{XID}', str(xid)).split()
child = Popen(cmd)
wait = cmd[:2] ==
_dynamic_childs[str(w)] = (child, cmd, wait)