SYNTAX
wid=XSButton(parent,x,y,width,height,name,function) XSWidget *wid,*parent; int x,y,width,height; char *name; void (*function)(XSWidget *);
DESCRIPTION
XSButton create a button 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 callback function is actived.
All operations of XSButton in the X server are delayed until XSCheckEvent is executed.
Example
#include <xstep.h> #include <stdlib.h> #include <stdio.h> void actionf(XSWidget *wid) { printf("action!\n"); } int main(int argc,char **argv) { XSWidget *d1,*w1; d1=XSDesktop(getenv("DISPLAY"),argv,argc); w1=XSWindow(d1,0,0,400,400,"button example"); XSButton(w1,-88,-8,72,24,"Action",actionf); XSButton(w1,-8 ,-8,72,24,"Close",XSWindowClose); while(XSCheckEvent(d1,XS_BLOCK)); return 0; }