oemcke@cs.flinders.OZ.AU (Susan Annette Oemcke) (05/17/91)
Hi,
I'm having trouble with my parent widget collapsing around my
child widget.
I have declared a widget draww, then I have made it a window using
XtWindow. I then put into draww 1 or 2 widgets. These
I will include below. draww has the dimensions of 500 x 250 to
start with. After inserting the smaller widget into it, it collapses
around it. I have tried a fix, that is using XtConfigureWidget(draww,...). This
will keep draww the right size but another widget goes over the top of
draww. This other widget gets pushed further back as I put in more widgets to
draww. I am at a loss as to what to try next and would appreciate help
on this. Relevant declarations are included.
One related problem is that I get with this is that anything drawn in the window
of draww ends up going behind the widgets. Even if I clear the window and redraw
the objects I still get stuff behind the widgets. That is if I do this within the
call back, if I do it after the widgets are on the screen then it works.
Thanks for your help.
Sue O (oemcke@cs.flinders.oz.au)
Widget1
clock = XtCreateManagedWidget("clock",clockWidgetClass, draww, NULL,0);
XtConfigureWidget(clock,400,400,70,70,2);
XtConfigureWidget(draww,1,1,500,250,1);
Widget 2
Widget box2, label1, label2, quit;
box2 = XtCreateManagedWidget("box2",boxWidgetClass, draww, NULL,0);
label1 = XtCreateManagedWidget("backing up to come",labelWidgetClass,
box2,NULL,0);
label1 = XtCreateManagedWidget("This is wonderful!!",labelWidgetClass,
box2,NULL,0);
quit = XtCreateManagedWidget("quit",commandWidgetClass, box2, NULL,0);
XtAddCallback(quit, XtNcallback, Quit, NULL);
XtConfigureWidget(draww,1,1,500,250,1);
In the main program I have these declarations
toplevel = XtAppInitialize(&app, "Goodbye", NULL,
NULL, &argc, argv, fallback_resources, NULL, NULL);
box = XtCreateManagedWidget("box", boxWidgetClass, toplevel, formargs,
XtNumber(formargs));
XtRealizeWidget(toplevel);
draww = XtCreateManagedWidget("draww",boxWidgetClass,box,args,
XtNumber(args));
draw_window = XtWindow(draww);
Widget1 and Widget2 are called by
clock = XtCreateManagedWidget("clock", commandWidgetClass, main_menu,
NULL,0);
XtAddCallback(clock, XtNcallback, Clock, NULL);
backup = XtCreateManagedWidget("backup", commandWidgetClass,
lower_menu, NULL,0);
XtAddCallback(backup, XtNcallback, Backup, NULL);