[comp.windows.x] Athena Widget Set

manu@ORC.OLIVETTI.COM (Manu Das) (06/13/90)

I have a small app with couple of text widgets and command buttons. One of the
command button pops up a dialog box. Before the dialog box is popped up, the
text widgets accept input. I can enter/edit text without any problem. But
after the dialogbox is popped up and down the text widgets stop accepting 
any inputs. I don't see any connection between the two. Can you help me?

Also, I would like to use a toggle widget. But it seems that Chris Peterson has
mentioned in the code for Toggle.c that 
	actions = SuperClass->core_class.actions; does not work. So, he has exported 
the action table of command widget. Is there any alternative to what Chris has
done. Has it been fixed in release 4?

I was told that toplevel shell can have only child, but it seems to me that
the popup shell is also a child of toplevel. Am I wrong?

Suppose I have a cmdBtn which calls XtPopup ,to popup a dialog box with done and
cancel buttons,in it's callback function. In the DialogDone or DialogCancel 
function, is it possible to find out the name of that cmdBtn?
Thanks a LOT. Manu Das
email address: manu@orc.olivetti.com

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (06/13/90)

> text widgets stop accepting 
> any inputs. I don't see any connection between the two. Can you help me?

I have seen this behavior in R3, it seemed to be an interaction between Xt and
the window manager's focus management stuff.  I believe that this was fixed in
R4, however.  If you are running R4 and still having the problem, send me a
SHORT example program, and I will take a look.

> Also, I would like to use a toggle widget. But it seems that Chris Peterson has
> mentioned in the code for Toggle.c that...

This was necessary to allow the Toggle to override the Command's set() action. 
The hack I had to add is still necessary in R4, but the Toggle does work just
fine.  It should only affect you if you are subclassing your own widgets.

> I was told that toplevel shell can have only child, but it seems to me that
> the popup shell is also a child of toplevel. Am I wrong?

There are two types of Children in Xt, Popup children and Normal children. 
Popup children are things like menus and dialog boxes.  The shell can have only
1 normal child, but any number of popup children.  Popup children are not
managed by the geometry manager of their parent, and are not sub-windows of
their parent's window.  

> Suppose I have a cmdBtn which calls XtPopup ,to popup a dialog box with done and
> cancel buttons,in it's callback function. In the DialogDone or DialogCancel 
> function, is it possible to find out the name of that cmdBtn?

The callback functions return the widget that caused them to be invoked (in this
case the command buttons)  You can retreive the name of the Command button by
using the XtName() function on the widget argument to the callback routine.

> Thanks a LOT. Manu Das

You're welcome.

						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213