[comp.windows.open-look] custom Help window?

barnett@grymoire.crd.ge.com (Bruce Barnett) (11/13/90)

I want to create a custom Help Command Frame.

I want to build a document (all text) at run time, and show it to the
user when they press the Help key. The XView manual is very terse in
this regards.

I tried making a command subframe (page 67 of the XView manual, example 4-5)
with a textsw inside it, but the text and scrollbar are positioned at
the bottom of the subframe. Is this a bug? Does anyone have a better way?

Example buggy code:

#include <xview/xview.h>
#include <xview/termsw.h>

#define HELPSTRING "This is sample help text!\n"   

main(argc,argv)
    int argc;
    char *argv[];
{
    Frame frame, subframe;
    Textsw	sub_view;
    Textsw_index	sub_index;

    xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);

    frame = (Frame)xv_create(NULL, FRAME,
        XV_WIDTH,       400,
        XV_HEIGHT,      400,
        FRAME_LABEL,    "Base Frame",
        NULL);

    subframe = (Frame)xv_create(frame, FRAME_CMD,
        XV_WIDTH,       400,
        XV_HEIGHT,      800,
        FRAME_LABEL,    "Popup",
        NULL);

    sub_view	= (Textsw) xv_create(subframe, TEXTSW, NULL);
    sub_index = textsw_insert(sub_view,HELPSTRING, strlen(HELPSTRING));
    window_fit(subframe); 

    xv_set(subframe, XV_SHOW, TRUE, NULL);

    xv_main_loop(frame);
}
--
Bruce G. Barnett	barnett@crd.ge.com	uunet!crdgw1!barnett