Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!sorak.kaist.ac.kr!jwkim
From: jwkim@sorak.kaist.ac.kr (JangWook Kim)
Newsgroups: comp.windows.x
Subject: Ask for the problem of X Toolkit
Message-ID: <8809200442.AA21392@cosmos.kaist.ac.kr>
Date: 20 Sep 88 05:42:59 GMT
Sender: daemon@bloom-beacon.MIT.EDU
Organization: The Internet
Lines: 64


Dear,

In the X Toolkit(X11R2), XtNx(XtNy)-the one of the resources of 
argument list of the Widget Class- for the x(y) coordinate doesn't work.
Sample program(Goodbye.c, as described below) of displaying 
a window with a label and a command button also doesn't work.

What's wrong with the line 31,32,37, and 38(that don't work) 
of the program below?

I expect your reply.


#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

void Callback(widget,clientData,callData)
Widget widget;
caddr_t clientData,callData;
{
	(void) printf("Goodbye, cruel world\n");
	exit(0);
}

int main(argc,argv)
unsigned int argc;
char **argv;
{
	Widget toplevel,box,label,command;
	Arg arg[25];
	unsigned int n;

	toplevel = XtInitialize("goodbye","Goodbye",NULL,0,&argc,argv);

	box = XtCreateManagedWidget("box",formWidgetClass,toplevel,(Arg*)NULL,0);

	n = 0;
	XtSetArg(arg[n],XtNx,10);		n++;
	XtSetArg(arg[n],XtNy,10);		n++;
	XtSetArg(arg[n],XtNlabel,"Goodbye, world");		n++;
	label = XtCreateManagedWidget("label",labelWidgetClass,box,arg,n);

	n = 0;
	XtSetArg(arg[n],XtNx,10);		n++;
	XtSetArg(arg[n],XtNy,40);		n++;
	XtSetArg(arg[n],XtNlabel,"Click and die");		n++;
	command = XtCreateManagedWidget("command",commandWidgetClass,box,arg,n);
	XtAddCallback(command,XtNcallback,Callback,NULL);

	XtRealizeWidget(toplevel);
	XtMainLoop();
}

Yours truly,

Jangwook Kim.
(jwkim@cosmos.kaist.ac.kr)