Skip navigation.
Home
The QNX Community Portal

View topic - problems with drawing threads

problems with drawing threads

For discussion of realtime and/or embedded programming.

problems with drawing threads

Postby witos » Sun Jan 25, 2009 12:12 am

Hello,

To simplify my problem i want to write aplication which draws in thread every 3 seconds new reactangle, code below

int myThreads(void)
{
int i = 0;
int j = 0;
int color = 0;

while(1)
{
PtEnter(0);
if (color == 1)
{
PgSetFillColor(Pg_BLACK);
color = 0;
}
else
{
PgSetFillColor(Pg_BLUE);
color = 1;
}
PgDrawIRect(i, i, i+5, i+5, Pg_DRAW_FILL);
PtLeave(0);
i = i + 5;
sleep(1);
}
return 0;
}


I made plain applciacation in appBuilder. It works fine only when i move mouse from plain outside and again inside. Otherwise reactangels arent drawn only when i get back with my mouse courser back to the plain :( And then stops again, whne i get with the mouse coursor outside, there is refrech and stops again :(
Have you got any hints for me ?
witos
Active Member
 
Posts: 11
Joined: Mon Jan 19, 2009 2:55 am

Return to Realtime and Embedded

Who is online

Users browsing this forum: No registered users and 4 guests