Hi everyone,
I'm working on a small EDA project which using tcl and Qt framework. And we know a lot of EDA software from synopsys/cadence/mentor all use the tcl & GUI (Qt or TK?). User types customized tcl commands and then the application executes commands and invokes GUI window and everything.
After I learned tcl and qt mainloop working mechanism , I found there is one way to mix Qt and tcl, and there is solution already from a talent:
http://jefftrull.github.io/eda/qt/tcl/eventloop/2012/05/25/integrating-qt-tcl-event-loops.html.
Yes, that solves the Qt and tcl mix. And we know synopsys/cadence/mentor's eda software supports automatic completion function or something else. That is when user type "t", The custom completion script will return a list of completions which is begin with "t". And I continue to study, and find a tool named "tclreadline", Yes that supports the automatic completion function, But I found that only works in tcl mainloop. The solution from jefftrull is Qt mainloop with timer invokes tcl commands. So tclreadline is not working on this solution.
Looks synopsys/cadence/mentor's solution is not 2 processes: tcl process and Qt process invoked each other. And also looks their application is like a linux terminal, supporting linux shell and tcl commands and customized tcl command and also GUI window. And we know the GUI window needs mainloop to refresh the window & receive interaction. So how does their tcl supports interaction without tcl own mainloop? I have no idea about their working mechanism. I'm confused, how synopsys/cadence/mentor make it? (using tcl commands with auto-completion, while start GUI program.)
Sorry for my English, I hope you understand. Can anyone help me. Any idea is welcome. Thank you!