[comp.windows.x] Viewport, TextWidget etc. -- strange problem...

kochhar@endor.harvard.edu (Sandeep Kochhar) (08/01/89)

hi!

I seem to be having a strange problem trying to use a textwidget
within a viewport within a vpane.  Basically, the example below
shows the following on our machine:  as expected it starts up
with a label pane, a viewport pane (containing horizontal scroll
bar and a textwidget child with a vertical scroll bar), and another
label pane.  Now when I pull the grip separating the viewport from
the lower label downwards, i.e. expanding the viewport, the
vertical scroll bar for the text widget doesn't grow;  also the
text widget seems confused about its size as is obvious from
its scrolling. Any ideas?

thanks in advance.

-sandeep kochhar

----------------------------cut here---------------------
#include <X11/Intrinsic.h>
#include <X11/Cardinals.h>
#include <X11/StringDefs.h>
#include <X11/Label.h>
#include <X11/Viewport.h>
#include <X11/VPaned.h>
#include <X11/Shell.h>
#include <X11/AsciiText.h>

#define MAX_ARGS	10
static Arg args[MAX_ARGS];
main(argc, argv)
	unsigned int argc;
	char **argv;
{
	Widget toplevel, vpane, title, vport, text;

	toplevel = XtInitialize("main", "Demo", NULL, ZERO, &argc, argv);
	XtSetArg(args[0], XtNwidth, 300);
	XtSetArg(args[1], XtNheight, 300);
	vpane = XtCreateManagedWidget("vpane", vPanedWidgetClass,
					toplevel, args, TWO);

	title = XtCreateManagedWidget("Text Test", labelWidgetClass, 
						vpane, args, ZERO);

    XtSetArg(args[0], XtNallowHoriz, True);
    XtSetArg(args[1], XtNforceBars, True);
    XtSetArg(args[2], XtNallowResize, True);
    vport = XtCreateManagedWidget("view", viewportWidgetClass,
                    vpane, args, THREE); 

    XtSetArg(args[0], XtNfile, "/usr/include/stdio.h");
    XtSetArg(args[1], XtNtextOptions, (resizeHeight |
            scrollVertical | wordBreak));
    XtSetArg(args[2], XtNheight, 100);
    XtSetArg(args[3], XtNwidth, 500);
    text = XtCreateManagedWidget("text", asciiDiskWidgetClass,
                vport, args, FOUR);

	title = XtCreateManagedWidget("Text Test", labelWidgetClass, 
						vpane, args, ZERO);
	XtRealizeWidget(toplevel);
	XtMainLoop();
}
---------------------------------cut here------------------------

Sandeep Kochhar
(617) 495-9515              mail: kochhar@harvard.harvard.edu
Harvard University                kochhar@harvard.csnet
33 Oxford st,                     kochhar@harvard.uucp
Cambridge, Ma 02138               kochhar@harvard.bitnet

"If you didn't get this message, please let me know."

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (11/02/89)

Okay, given this new info how about this:

France:

	F NorS S RUS F Hol -> HelB		**CHANGED**

	F Ska -> Den **or** F Ska S RUS A Nor -> Swe

	A Ruhr S RUS A Mun -> Kie

	A Tyr -> Mun
	[ also I attempt to take out Wales ]

USSR:

	A Mun -> Kie
	A Nor -> Swe
	F StP(NC) -> Nor
	F Hol -> HelB				**CHANGED**


The change is that you move into HelB supported by me instead of the
other way around.  The reason for this is that is leaves me with a fleet
in the NorS.  This fleet is absolutely essential in case he moves Yor -> Lon.

The only hitch of doing things this way is that if England move any unit other
than HelB into the NorS my support is cut and we lose.  Can you get England to
move so that he will not cut this support?  If we can do this
sort of move I think we will be left in a better stragic position in the Fall.

The fleet in the NorS would be Nice!!!

					France

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (11/02/89)

> Okay, given this new info how about this:
> France:

[ random stuff deleted. ]

Sorry about this folks, I replied to the wrong thing (obviously).  

That's what happens when you click the wrong button in xmh, sigh...

					
					Chris