[15641] in Athena Bugs
No subject found in mail header
daemon@ATHENA.MIT.EDU (Claude Indermitte)
Mon Nov 3 17:47:11 1997
Date: Mon, 3 Nov 1997 17:47:10 -0500
From: Claude Indermitte <indermit@MIT.EDU>
To: bugs@MIT.EDU
OSF Problem Report
=================================
Submitter Information (Include Email address at miminum)
---------------------
Submitter Name: Claude Indermitte
Organization: MIT
Email Address: indermit@mit.edu
Phone: 617/253 3885
OSF License Number: 23
Hardware/Software Configuration
-------------------------------
Offering and Version: Motif 1.2.2
Component (Module): Xm/MainW.h,Xm/DrawingA.h
Client Hardware: sun SPARC 4
Client Software: SUNOS 5.5.1
Server Hardware: SAME
Server Software: SAME
Compiler: g++
Problem Description
-------------------
Severity Level: Critical
Date of First Occurrence: <Date problem was first noticed (optional)>
One Line Description:
Moving the scrollbar of a mainwindow modifies the position an object is drawn.
Full Description:
If you fill a triangle at a given position, then move the scrollbar, then
fill again the triangle at the same coordinates, the triangle is not exactly
at the same position than the previous one.
Repeat By:
The following program
#include <Xm.h>
#include <Xm/MainW.h>
#include <Xm/DrawingA.h>
Widget drawing_area;
void fill_poly(Widget, XtPointer, XEvent*, Boolean*)
{
XPoint lpt[3];
GC gc;
gc = XCreateGC(XtDisplay(drawing_area), XtWindow(drawing_area), 0, NULL);
XSetFunction(XtDisplay(drawing_area), gc, GXinvert);
lpt[0].x = 320; lpt[0].y = 552;
lpt[1].x = 339; lpt[1].y = 513;
lpt[2].x = 300; lpt[2].y = 513;
XFillPolygon(XtDisplay(drawing_area), XtWindow(drawing_area), gc, lpt, 3,
Convex, CoordModeOrigin);
}
int main(int argc, char *argv[])
{
int i;
Widget top_level_widget;
Widget pshell;
Arg args[10];
i = 0;
top_level_widget = XtInitialize("test_triangle",NULL, NULL, 0, &i, NULL);
i=0;
XtSetArg(args[i],XmNscrollingPolicy, XmAUTOMATIC);i++;
XtSetArg(args[i],XmNheight, 600);i++;
XtSetArg(args[i],XmNwidth, 600);i++;
pshell = XmCreateMainWindow(top_level_widget,"drawing", args, i);
XtManageChild(pshell);
i=0;
XtSetArg(args[i],XmNheight, 800);i++;
XtSetArg(args[i],XmNwidth, 800);i++;
drawing_area = XmCreateDrawingArea(pshell, "test", args, i);
XtManageChild(drawing_area);
XmMainWindowSetAreas(pshell,NULL,NULL,NULL,NULL,drawing_area);
XtAddEventHandler(drawing_area, ButtonPressMask, FALSE, fill_poly, NULL);
XtRealizeWidget(top_level_widget);
XtMainLoop();
}
Proposed Solution:
<A short description of how to fix the problem/bug (optional)>