subroutine event_display_open_window(ireturn_code) c c ********************************************************************** c c open an event display graphics window. c c George Gollin, CPPM (Marseille) and univerisyt of Illinois (Urbana-Champaign) c g-gollin@uiuc.edu, 1999 c c ********************************************************************** c c include files holding common blocks and parameter statements go here: c note that they're in the same directory as this file. c #include "event_display.inc" c c ********************************************************************** c c non-common type definitions and array definitions go here: c c first time this routine is called: logical first_time, debug c c ********************************************************************** c c data statements go here: c c first time we're entering the routine: data first_time /.true./ c c turn on/off debug outputs: data debug /.false./ c c ********************************************************************** c c c initialize stuff: if(first_time) then first_time=.false. if(debug) print *,' event_display_open_window first time' end if c c c quit if the window is already open... if(window_is_open) then if(debug) print *,' graphics window is already open.' ireturn_code=-1 return end if c c c hostname was set by the one argument provided when starting the c event display... determine length of hostname: length_hostname=lenocc(hostname) if(debug) print *,' hostname to be used is ', . hostname(1:length_hostname) c c c use a HIGZ routine to open an X11 display: return code -1 if problems. ireturn_code=ixopnds(length_hostname, hostname) c c if(debug) then print *,' just tried to open an X11 display...' print *,' ireturn_code is ',ireturn_code end if c c c display opened OK? if(ireturn_code .ne. 0) then print *,' event_display_open_window failed to open display!' print *,' return code was ', ireturn_code print *,' hostname tried was ',hostname(1:lenocc(hostname)) return end if c c c ask for dimensions of the display now. call ixgetge(-1, ix, iy, iwidth, iheight) c c now set the values I'll use: check to see that the window will fit inside c the display. if(iwidth .ge. ix11window1_width_default) then ix11window1_width=ix11window1_width_default else ix11window1_width=iwidth end if c if(iheight .ge. ix11window1_height_default) then ix11window1_height=ix11window1_height_default else ix11window1_height=iheight end if c c c determine length of window title: length_window1title=lenocc(ix11window1_title) c c c now open an X11 window, also using a HIGZ routine: motif_window_is_required=0 ix11window1_id=ixopnwi(ix11window1_x0, ix11window1_y0, . ix11window1_width, ix11window1_height, . length_window1title, ix11window1_title, . motif_window_is_required) c c if(debug) then print *,' just tried to open an X11 window...' print *,' ix11window1_id is ',ix11window1_id end if c c c window opened OK? if(ix11window1_id .eq. -1) then print *,' event_display_open_window failed to open window!' ireturn_code=ix11window1_id return end if c c c set color index 1 to be white (R/G/B intensities all set to 1.0): call ixsetco(index_color_white, 1., 1., 1.) c set other indices too: call ixsetco(index_color_black, 0.00, 0.00, 0.00) call ixsetco(index_color_red, 1.00, 0.00, 0.00) call ixsetco(index_color_green, 0.00, 0.60, 0.00) call ixsetco(index_color_blue, 0.00, 0.00, 1.00) call ixsetco(index_color1, 0.00, 0.10, 0.10) call ixsetco(index_color2, 0.50, 0.50, 0.00) call ixsetco(index_color3, 0.25, 0.25, 0.25) call ixsetco(index_color_button, 0.996, 0.627, 0.478) call ixsetco(index_color_message, 0.996, 0.961, 0.902) call ixsetco(index_color_xview, 1., 1., 0.95) call ixsetco(index_color_yview, 0.94, 1., .94) c call ixsetco(index_color_yview, 0.902, 0.996, 0.961) c call ixsetco(index_color_yview, 0.961, 0.902, 0.996) c call ixsetco(index_color_yview, 1., 1., 1.) c c c now set the fill area color: call ixsetfc(index_color_message) c c also set the line color (to black): call ixsetlc(index_color_black) c c also set the text color: call ixsettc(index_color_black) c c c that's all! ireturn_code=0 c return end