Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tcl and Qt

209 views
Skip to first unread message

tcli...@gmail.com

unread,
May 8, 2006, 2:28:17 PM5/8/06
to
Hi:

Could anyoe point to me how to use Tcl_SetMainLoop to setup event loop
procedure for Qt window ?

I have Qt programs and use SWIG to build a Tcl interface. At
the end of main() it is
Tcl_Main(), which handles different event loop than Qt's.
How to combine them together ?

Any examples will be appreciated.

Thanks

-Todd

Message has been deleted

tcli...@gmail.com

unread,
May 8, 2006, 5:02:57 PM5/8/06
to
Thanks ! Sascha -Todd

tcli...@gmail.com

unread,
May 16, 2006, 4:15:12 AM5/16/06
to
Thanks for Andrew's help.
I post the solution here due to many askings about the integration of
Tcl and Qt event loops.
I hope it is useful.
Any suggestions/comments are welcomed.


--Todd


------ BEGIN------
#include <tcl.h>
#include "slider.h"


void qtloop(void)
{

while (1) {
qApp->processEvents();
Tcl_DoOneEvent(TCL_DONT_WAIT);
}

}

//
int main(int argc, char **argv) {

QApplication myApp(argc, argv);
MyMainWindow w;
myApp.setMainWidget(&w);
w.show();

Tcl_SetMainLoop(qtloop);
Tcl_Main(argc, argv, Tcl_AppInit);
return(0);

}


----- END -----------------------------------------------------------

0 new messages