PtRect Shows fill outside of boarder

When I try to display a PtRect under Neutrino I can seen the fill color
outside of the rectangle. This is not the case under QNX4. Does anyone
know of a way to get rid of the outline. The only thing I’ve come up with
in increate the boarder width to 2 pixels rather than 1. Following is a
small test app which should compile on both QNX6 and QNX4. Thanks for any
help.



int main (int argc, char *argv[])
{
PtArg_t args[10];
PhArea_t windowArea;
PhDim_t windowDim;
PhPoint_t pntRectLoc, pntRectSize;
short nArgs = 0;

// Set base pwndMain parameters.
nArgs = 0;
windowArea.pos.y = 10;
windowArea.pos.x = 10;
windowArea.size.w = 500;
windowArea.size.h = 500;
windowDim.w = 500;
windowDim.h = 500;
//PtSetArg(&args[nArgs++], Pt_ARG_AREA, &windowArea, 0);
PtSetArg(&args[nArgs++], Pt_ARG_DIM, &windowDim, 0);
PtSetArg(&args[nArgs++], Pt_ARG_FILL_COLOR, Pg_GRAY, 0);
PtSetArg(&args[nArgs++], Pt_ARG_WINDOW_TITLE, “PfExtentTextToRect”, 0);
PtSetArg(&args[nArgs++], Pt_ARG_WINDOW_RENDER_FLAGS, 0,
Ph_WM_APP_DEF_RENDER);
pwndMain = PtAppInit (NULL, 0, NULL, nArgs, args);

pntRectLoc.x = 250;
pntRectLoc.y = 250;
pntRectSize.x = 200;
pntRectSize.y = 30;
DisplayRectangle(pwndMain, 100, pntRectLoc, pntRectSize, Pg_BLUE,
Pg_WHITE);

PtRealizeWidget(pwndMain);
PtMainLoop ();

return(0);
}

void DisplayRectangle(PtWidget_t* _win, int _id, PhPoint_t _loc, PhPoint_t
_size, PgColor_t _border_color, PgColor_t _fill_color)
{
char *fnName = “CGERectangle::Init”;
PtArg_t args[15];
PhArea_t area;
PtWidget_t *rect;
int nArgs = 0;

area.pos = _loc;
area.size.h = _size.y;
area.size.w = _size.x;

nArgs= 0;
PtSetArg(&args[nArgs++], Pt_ARG_AREA, &area, 0);
PtSetArg(&args[nArgs++], Pt_ARG_COLOR, _border_color, 0);
PtSetArg(&args[nArgs++], Pt_ARG_FILL_COLOR, _fill_color, 0);
PtSetArg(&args[nArgs++], Pt_ARG_BORDER_WIDTH, 0, 0);
#ifndef _QNX425
PtSetArg(&args[nArgs++], Pt_ARG_BEVEL_WIDTH, 0, 0);
PtSetArg(&args[nArgs++], Pt_ARG_BASIC_FLAGS, Pt_FALSE, Pt_ALL);
#endif
PtSetArg(&args[nArgs++], Pt_ARG_LINE_WIDTH, 1, 0);
#ifndef _QNX425
PtSetArg(&args[nArgs++], Pt_ARG_INLINE_COLOR, Pg_RED, 0);
PtSetArg(&args[nArgs++], Pt_ARG_OUTLINE_COLOR, Pg_RED, 0);
#endif

rect = PtCreateWidget(PtRect, _win, nArgs, args);

if(NULL == rect)
printf("%s: Error creating rectangle\n",fnName);

if(-1 == PtRealizeWidget(rect))
printf("%s: Error realizing widget
(border,fill)(x,y,w,h)=(0x%08x,0x%08x)(%d,%d,%d,%d)\n",fnName,_border_color,
_fill_color,area.pos.x,area.pos.y,area.size.w,area.size.h);
}


\

Jeffrey B. Holtz
Software Engineering
Electro Scientific Industries, Inc.
Ph: 734-332-7054
Fax: 734-332-7077
email: holtzj@esi.com

Well I was able to get around this by setting the Pt_ARG_INSIDE_COLOR to my
fill color and the Pt_ARG_FILL_COLOR to Pg_TRANSPARENT. I guess the
definition changes moving to QNX6?!?


Jeffrey B. Holtz
Software Engineering
Electro Scientific Industries, Inc.
Ph: 734-332-7054
Fax: 734-332-7077
email: holtzj@esi.com
“Jeff Holtz” <holtzj@esi.com> wrote in message
news:ap960i$j90$1@inn.qnx.com

When I try to display a PtRect under Neutrino I can seen the fill color
outside of the rectangle. This is not the case under QNX4. Does anyone
know of a way to get rid of the outline. The only thing I’ve come up with
in increate the boarder width to 2 pixels rather than 1. Following is a
small test app which should compile on both QNX6 and QNX4. Thanks for any
help.



int main (int argc, char *argv[])
{
PtArg_t args[10];
PhArea_t windowArea;
PhDim_t windowDim;
PhPoint_t pntRectLoc, pntRectSize;
short nArgs = 0;

// Set base pwndMain parameters.
nArgs = 0;
windowArea.pos.y = 10;
windowArea.pos.x = 10;
windowArea.size.w = 500;
windowArea.size.h = 500;
windowDim.w = 500;
windowDim.h = 500;
//PtSetArg(&args[nArgs++], Pt_ARG_AREA, &windowArea, 0);
PtSetArg(&args[nArgs++], Pt_ARG_DIM, &windowDim, 0);
PtSetArg(&args[nArgs++], Pt_ARG_FILL_COLOR, Pg_GRAY, 0);
PtSetArg(&args[nArgs++], Pt_ARG_WINDOW_TITLE, “PfExtentTextToRect”, 0);
PtSetArg(&args[nArgs++], Pt_ARG_WINDOW_RENDER_FLAGS, 0,
Ph_WM_APP_DEF_RENDER);
pwndMain = PtAppInit (NULL, 0, NULL, nArgs, args);

pntRectLoc.x = 250;
pntRectLoc.y = 250;
pntRectSize.x = 200;
pntRectSize.y = 30;
DisplayRectangle(pwndMain, 100, pntRectLoc, pntRectSize, Pg_BLUE,
Pg_WHITE);

PtRealizeWidget(pwndMain);
PtMainLoop ();

return(0);
}

void DisplayRectangle(PtWidget_t* _win, int _id, PhPoint_t _loc, PhPoint_t
_size, PgColor_t _border_color, PgColor_t _fill_color)
{
char *fnName = “CGERectangle::Init”;
PtArg_t args[15];
PhArea_t area;
PtWidget_t *rect;
int nArgs = 0;

area.pos = _loc;
area.size.h = _size.y;
area.size.w = _size.x;

nArgs= 0;
PtSetArg(&args[nArgs++], Pt_ARG_AREA, &area, 0);
PtSetArg(&args[nArgs++], Pt_ARG_COLOR, _border_color, 0);
PtSetArg(&args[nArgs++], Pt_ARG_FILL_COLOR, _fill_color, 0);
PtSetArg(&args[nArgs++], Pt_ARG_BORDER_WIDTH, 0, 0);
#ifndef _QNX425
PtSetArg(&args[nArgs++], Pt_ARG_BEVEL_WIDTH, 0, 0);
PtSetArg(&args[nArgs++], Pt_ARG_BASIC_FLAGS, Pt_FALSE, Pt_ALL);
#endif
PtSetArg(&args[nArgs++], Pt_ARG_LINE_WIDTH, 1, 0);
#ifndef _QNX425
PtSetArg(&args[nArgs++], Pt_ARG_INLINE_COLOR, Pg_RED, 0);
PtSetArg(&args[nArgs++], Pt_ARG_OUTLINE_COLOR, Pg_RED, 0);
#endif

rect = PtCreateWidget(PtRect, _win, nArgs, args);

if(NULL == rect)
printf("%s: Error creating rectangle\n",fnName);

if(-1 == PtRealizeWidget(rect))
printf("%s: Error realizing widget

(border,fill)(x,y,w,h)=(0x%08x,0x%08x)(%d,%d,%d,%d)\n",fnName,_border_color,
_fill_color,area.pos.x,area.pos.y,area.size.w,area.size.h);
}


\

Jeffrey B. Holtz
Software Engineering
Electro Scientific Industries, Inc.
Ph: 734-332-7054
Fax: 734-332-7077
email: > holtzj@esi.com