Xgen sliders

John Cartwright johncc at picea.CFNR.ColoState.EDU
Sat Sep 19 00:50:01 EDT 1992


Hello all,

I'm having a problem with xgen that is driving me to distraction (although xgen 
itself is really an incredible piece of software!).  Anyway the problem comes in
trying to use the slider object and retireve the value that is set.  As far as I
can tell from the documentation, the script listed below should work, but 
unfortuantely, the "accept" button causes the program to behave erratically and 
finally to crash with a segmentation fault.

The real issue for me is retrieving the value set by the slider and storing it 
in a shell variable for use in a command line argument and for later use in the 
xgen script.  Any help or suggestions would greatly appreciated.

John Cartwright
johncc at picea.cfnr.colostate.edu

/* XGEN script to receive user input via text entry and slider object.

#define DarkFG  foreground:NavajoWhite
#define LightBG background:black
#define DarkBG  background:NavajoWhite	
#define LightFG foreground:black

DarkBG
LightFG
font:"*adobe*helv*r*normal*14*"

/* beginning of the first environment...  */
environment firstEnv

	initialshells:"Main"
{
	commandboard Main
		titlestring:"Main Window"
		x:0 
		y:0 
		background:IndianRed
		setOPTIONS:""
		setWSHD_DESCRIPT:""
		setFILE_NAME:""
		setMAP_PREFIX:""
	(
		separator I1
		       separatortype:singleline
			x:0 y:50 width:500
                        ;
		label "Enter Watershed Description"
			font:"*adobe*helv*r*normal*14*"
			alignment:center
			x:0 y:75
			width: 500
			;
		textentry t2
			x:0 y:100
			width:500
			;
                slider rain
                        titlestring:"Set Rainfall Amount in Inches"
                        font:"*adobe*helv*med*r*normal*14*"
                        x:0 y:150 foreground:black background:IndianRed
			decimalpoints:0
			orientation:horizontal
			startvalue:0
			minimum:0 maximum:50
			;
                button "Accept"
			x:0 y:300 width:250 alignment:center
			height:60 popdown:Main popup:showResults
                        ; 
		button "QUIT" 
			x:0 y:400 width:250 alignment:center
			foreground:IndianRed height:60 popdown:Main
			exit:0 
			;
	)
	commandboard showResults
	setRESULT:"[rain]"
	(
		label "Results Summary"
		x:0 y:0 width:350
		;
		label "rainfall amount = "
		x:0 y:75 width:50
		;
		label value 
		x:50 y:75 titlestring:"$RESULT"
		font:"*adobe*helv*bold*r*norm*14*"
		alignment:center
		;
		separator a1
		separatortype:doubledashedline
		;
		button "OK"
		x:0 y:150
		popdown:showResults popup:Main	
		;
	)
}



More information about the grass-user mailing list