XSRadio

SYNTAX

        wid=XSRadio(parent,x,y,width,height,name,data,mask)

        XSWidget *wid,*parent;
        int  x,y,width,height;
        char *name;
        int  *data,mask;

DESCRIPTION

XSRadio create a radiobox widget inside the selected parent, in the position x,y with size width,height and label name. When mouse button is pressed and released inside this widget, a internal status is inverted.

If internal status is true, the value of mask will be copied in *data. The value of mask must be a unique 32 bit value and a 32 bit integer can be shared by many radioboxes, but only one will have internal status true.

All operations of XSRadio in the X server are delayed until XSCheckEvent is executed.

Example

#include <xstep.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc,char **argv) {

	XSWidget *d1,*w1;

	int radio=1;

	d1=XSDesktop(getenv("DISPLAY"),argv,argc);
	w1=XSWindow(d1,0,0,400,400,"radio example");

	XSRadio(w1,8,8+0*24,200,21,"680x0",&radio,1);
	XSRadio(w1,8,8+1*24,200,21,"80x86",&radio,2);

	XSButton(w1,-8,-8,72,24,"Close",XSWindowClose);
	
	while(XSCheckEvent(d1,XS_BLOCK)) {

		if(radio==1) printf("radio value is '680x0'\n"); 
		if(radio==2) printf("radio value is '80x86'\n");    
	}                                        
	return 0;
}