🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #37792

athena text widget funny

#37792
From: Chris Rouch
Date: Wed, 07 Mar 1990 11:10
67 lines
2743 bytes
I'm having problems using the R4 athena text widget. I'm creating a
popup shell and hanging a text widget and a close button off it. The
problem comes when I try and close the shell down. If I just type in the
widget there's no problem, but if I use meta-I to include a file the
program crashes. I can manually cut and paste the same file into the
widget without causing a crash. I'm sure I must be doing something
silly, 'cos xmh and xrn don't have this problem (although the popup
program in examples/Xaw does). A noddy example of this is shown below:

------------------------------
Widget shell;

void do_test(w,client_data,call_data)
Widget w;
XtPointer client_data, call_data;
{
void close_test();
Arg args[10];
char buffer[BIGBUFF];
Widget sub,title,editw,outer,closew;

	XtSetArg(args[0],XtNgeometry,"500x500");
	shell =XtCreatePopupShell("xsr", topLevelShellWidgetClass,toplevel,args,1);
    	sub =XtCreateManagedWidget("sub", panedWidgetClass, shell,NULL,0);
	title = XtCreateManagedWidget("title",labelWidgetClass,sub,NULL,0);
	XtSetArg(args[0],XtNeditType,XawtextEdit);
	XtSetArg(args[1],XtNstring,buffer);
	editw = XtCreateManagedWidget("edit",asciiTextWidgetClass,sub,args,2);
	XtSetArg(args[0],XtNskipAdjust,True);
	outer = XtCreateManagedWidget("tempButtons",boxWidgetClass,sub,args,1);
	closew = XtCreateManagedWidget("close",commandWidgetClass,outer,NULL,0);
	XtAddCallback(closew,XtNcallback,close_test,NULL);
	XtRealizeWidget(shell);
	XtSetKeyboardFocus( shell, sub );
	XtPopup(shell, XtGrabNone);
	
}

void close_test(w,client_data,call_data)
Widget w;
XtPointer client_data, call_data;
{
	XtPopdown(shell);
	XtDestroyWidget(shell);
}

----------------------

The end of the stack dump looks like this:

_XtWidgetToApplicationContext+0x70:     __XtWindowedAncestor    (0xB9F6C)
__XawTextExecuteUpdate+0x64:    _XtDestroyWidget(0xB9F6C)


If I replace the XtDestroyWidget() call with XtUnmapWidget() there's no
problem. 

Any help would be appreciated.

Thanks,

Chris
-----------------------------------------------------------------------------
Chris Rouch                                             crouch@axion.bt.co.uk
RT3141, BTRL, Martlesham Heath, Ipswich, England.              +44 473 646093

Pick a card. Any card. WRONG.
Technical Details
Message-ID: <1990Mar7.111035.23468@axion.bt.co.uk>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!axion!axion.bt.co.uk!crouch

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!axion!axion.bt.co.uk!crouch
From: crouch@axion.bt.co.uk (Chris Rouch)
Newsgroups: comp.windows.x
Subject: athena text widget funny
Message-ID: <1990Mar7.111035.23468@axion.bt.co.uk>
Date: 7 Mar 90 11:10:35 GMT
Sender: news@axion.bt.co.uk
Reply-To: crouch@axion.bt.co.uk (Chris Rouch)
Organization: British Telecom Research Labs
Lines: 67