Mixing Qt with Tcl (missing event processing ?)
- From: lnguyen333@xxxxxxxxx
- Date: 14 Mar 2007 10:17:36 -0700
Hi,
i am working a Qt application that needs to work with some existing
TCL code.
The application works in most cases except when TCL brings up the
dialog
message box. At this point the whole application hung.
The communication code between Qt and TCL is a modified code of
tclXtNotification.cpp from the TCL package. Here is the code changed
that I made.
I think the events are not processing in right sequence or not being
process at all.
If I replace the Qt process event with the
XtAppProcessEvent(notifier.appContext, XtIMAll);
everything works fine.
Due to platform porting, i need to get rid all X related code so
this routine call must go.
I would greatly appreciate it, if anyone can tell what i did wrong and
how to fix it.
Madison
static int
WaitForEvent(
Tcl_Time *timePtr) /* Maximum block time, or NULL. */
{
int timeout = 0;
if (timePtr)
{
timeout = timePtr->sec * 1000 + timePtr->usec / 1000;
}
processEvent (timeout);
return 1;
}
static void
SetTimer(timePtr)
Tcl_Time *timePtr; /* Timeout value, may be NULL. */
{
long timeout;
if (notifier.currentTimeout != 0)
{
stopTimer();
}
if (timePtr)
{
timeout = timePtr->sec * 1000 + timePtr->usec / 1000;
startTimer (timeout);
notifier.currentTimeout = 1;
}
else
{
notifier.currentTimeout = 0;
}
}
// this routine is called by the QTimer timeout handler
void
timeoutHandler ()
{
notifier.currentTimeout = 0;
Tcl_ServiceAll();
}
// Here is the code that interface with Qt
void
processEvent (int timeout)
{
qApp->processEvents (timeout);
}
//----------------- start QTimer
void
startTimer (int timeOut_)
{
_proxy.startTimer (timeOut_);
}
// --------------- stop QTimer
void
stopTimer ()
{
_proxy.stopTimer ();
}
.
- Prev by Date: Tcl-DP binary for Windows XP?
- Next by Date: Decoding CJK characters to unicode in Tcl
- Previous by thread: Tcl-DP binary for Windows XP?
- Next by thread: Decoding CJK characters to unicode in Tcl
- Index(es):
Relevant Pages
|