[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1709.0. "XFillArc() problem ??" by TALLIS::ZANZERKIA () Thu Nov 09 1989 14:18

    There seems to be a problem with the XFillArc() routine. If you draw an
    alternating color, very close filled circles the display is smeared.
    Display comes out very un-even. Try the test program i have in next
    2 replies.
    	This very same program creates good results on Ultrix based
    servers. 
    
    Display server
    VS2000/Ultrix	No problem
    VS2000/VMS		bad display	I even tried on VMS5.3
    VS-II/VMS		bad display
    PMAX/Ultrix		No problem
    
    The client was tried on all different machines with same results.
    
    Note # 1018 & 1208 discusses the similar problem..
    
    Any idea what's going on ?? 
    Robert
    
T.RTitleUserPersonal
Name
DateLines
1709.1GTEST.C (re-entered, i had a typo)TALLIS::ZANZERKIAWed Nov 15 1989 16:51170
/****************************************************************************
    This application draws filled circles.. Select the FILE menu and pick
    the "test grphics" item.
    
****************************************************************************/
#include <stdio.h>
#ifdef VMS
#include <decw$include/DwtAppl.h>
#else
#include <X11/DwtAppl.h>
#endif

#define MAXARGS           4


/* UIL routines */
static XtCallbackProc test_graphics(),
                        ExitButtonActivated();
/*
   Digital Resource Manager (DRM) data structures
*/

static DRMHierarchy hierarchy;              /* DRM hierarch id */
static char *namvec[] = {"gtest.uid"};       /* DRM file list   */
static DRMCode class;

/* Associate UIL routine names with C-code routine names */

static DRMRegisterArg regvec[] = {
          {"test_graphics",(caddr_t)test_graphics},
          {"ExitButtonActivated", (caddr_t)ExitButtonActivated}
       };

Widget top_level;       /* Requiered for each application, invisible */
Widget main_window;     /* Application main window (empty) */
short root_x,root_y;
Arg args[MAXARGS];
GC defgc;

/*
   Macros for counting things in file and name lists
*/

#define nFiles(x)         (sizeof(x)/sizeof(char *))
#define nRegs(x)          (sizeof(x)/sizeof(DRMRegisterArg))

main(argc,argv)
   unsigned int argc;
   char *argv[];
{
   int status,n;

   /* Initialize the Digital Resource Manager */

   DwtInitializeDRM();

   /* Initialize the toolkit, and create the top-level widget */

   top_level = XtInitialize("Hi!","Example",NULL,0,&argc,argv);
   defgc = XDefaultGC(XtDisplay(top_level), DefaultScreen(XtDisplay(top_level)));

   n = 0;
   XtSetArg(args[n],XtNallowShellResize,True); ++n;
   XtSetValues(top_level,args,n);

   /* Define the DRM hierarchy, NOTE here in DECW we have to explictly
      open the resource file. */

   status = DwtOpenHierarchy(nFiles(namvec), /* number of files */
                             namvec,         /* file names */
                             NULL,           /* no extensions */
                             &hierarchy);    /* pointer to hierarchy id */

   if (status != DRMSuccess) {
      fprintf(stderr,"Can't open DRM hierarchy\n");
      exit(0);
   }

   /* Register callback routines */

   DwtRegisterDRMNames(regvec,nRegs(regvec));

   /* Ask DRM to create the pushbutton widget */

   status = DwtFetchWidget(hierarchy,    /* DRM hierarchy id */
                           "mainwindow", /* index of widget to fetch */
                           top_level,    /* parent widget */
                           &main_window, /* returned widget id */
                           &class);      /* returned widget class */

   if (status != DRMSuccess) {
      fprintf(stderr,"Can't fetch widget\n");
      exit(0);
   }

   /* Include fetched widget in its parent's managed set */

   XtManageChild(main_window);

   XtRealizeWidget(top_level);


   XtMainLoop();  /* Never returns */
}


/****************************************************************************
/*
/*      This function is invoked when "Test graphics" menu item is selected 
/*  (from the "File" menu).
/*      This function draws some graphics in the main window.
/*
/****************************************************************************/
static XtCallbackProc test_graphics(widget,tag,reason)
   Widget widget;
   char *tag;
   DwtAnyCallbackStruct *reason;
{
int status;
int x,y;
unsigned int width,height,i;
int angle1,angle2;
Boolean reverse = True;
Display *disp$;

    x = y = 35;
    width = height = 200;
    angle1 = 0;
    angle2 = 360*64;

    disp$ = XtDisplay(top_level);
    for(i=0;i < 45; i++)
    {
        width = height -= 4;
        x = y += 2;

        if(reverse)
        {
            XSetForeground(disp$, defgc,    
                 BlackPixel(disp$, XDefaultScreen(disp$)));
        }
        else
        {
            XSetForeground(disp$, defgc,    
                 WhitePixel(disp$, XDefaultScreen(disp$)));
        }
        reverse = !reverse;
        XFillArc(disp$, XtWindow(main_window), defgc,
        x,y, width ,height, 0, 360*64);
    }
}


/****************************************************************************
/*
/*      This function is invoked when "EXIT" is selected from "File" menu or
/*  from the dialog_box.
/*
/****************************************************************************/

static XtCallbackProc ExitButtonActivated(widget,tag,reason)
   Widget widget;
   char *tag;
   DwtAnyCallbackStruct *reason;
{
   exit(1);
}

    
    
1709.2GTEST.UIL (** PROBLEM Also submitted in QAR)TALLIS::ZANZERKIAWed Nov 15 1989 16:5398
    module Gtest
        version = 'v1.0'
        names = case_sensitive

include file 'decw$include:DwtAppl.uil';

value
        adb_top_attachment:     argument('adbTopAttachment', integer);
        adb_bottom_attachment:  argument('adbBottomAttachment', integer);
        adb_left_attachment:    argument('adbLeftAttachment', integer);
        adb_right_attachment:   argument('adbRightAttachment', integer);
        adb_top_widget:         argument('adbTopWidget', any);
        adb_bottom_widget:      argument('adbBottomWidget', any);
        adb_left_widget:        argument('adbLeftWidget', any);
        adb_right_widget:       argument('adbRightWidget', any);
        adb_top_offset:         argument('adbTopOffset', integer);
        adb_bottom_offset:      argument('adbBottomOffset', integer);
        adb_left_offset:        argument('adbLeftOffset', integer);
        adb_right_offset:       argument('adbRightOffset', integer);

value
	exit_label : compound_string('Exit');

procedure
        ExitButtonActivated();
	test_graphics();


object mainwindow : main_window {
		arguments {
			width = 300;
			height = 300;
			accept_focus = true;
		};
		controls {
			menu_bar    menu_bar_3b;
		};
};


object menu_bar_3b : menu_bar
{
	arguments {
                    orientation = DwtOrientationHorizontal;
                    spacing     = 15;   ! Spacing of items in the menu.
	};
	controls {
		pulldown_entry file_menu_entry;
	};
};

object file_menu_entry : pulldown_entry  ! "File" menu entry.
{
	arguments {
		label_label = "File";
		};
	controls {
		pulldown_menu file_menu;
	};
};

object file_menu : pulldown_menu ! "File" contents in the menu.
{
	arguments {
		orientation = DwtOrientationVertical;
	};
	controls {
		push_button mb_graphics;
		push_button mb_exit;
	};
};

object mb_graphics : push_button { ! "Test graphics"
	arguments {
		    label_label = "Test Graphics";
        	       accelerator_text = '^B';
	                button_accelerator = 'Ctrl<KeyPress>B:';
	};
	callbacks {
		    activate = procedure test_graphics();
	};
};

object mb_exit : push_button { ! "Exit"
	arguments {
		    label_label = "Exit";
	               accelerator_text = '^E';
        	        button_accelerator = 'Ctrl<KeyPress>E:';
	};
	callbacks {
		    activate = procedure ExitButtonActivated();
	};
};

end module;