Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!agate!ig!uwmcsd1!mailrus!rutgers!bellcore!dana From: dana@dino.bellcore.com (Dana A. Chee) Newsgroups: comp.windows.x Subject: Re: Text display using Xtoolkit Message-ID:Date: 7 Jul 88 13:19:56 GMT References: <8807062019.AA00670@apollo.zeus.com> Sender: news@bellcore.bellcore.com Organization: Bellcore, Morristown, NJ USA Lines: 89 In-reply-to: lind@OCLCRSUN.BITNET's message of 6 Jul 88 20:19:50 GMT In article <8807062019.AA00670@apollo.zeus.com> lind@OCLCRSUN.BITNET (Martha J. (Gordon) Lindeman) writes: >> We are building a full-text system using the Xtoolkit for V11R2 and >> need some information. >> 1. Has anyone gotten the viewport widget scrollbars to work >> without causing a core dump? Yes, the patches to viewport, as well as ones to Box are at the end. (remove signature from end) ==================== viewport and box patches ==================== *** Viewport.c.orig Thu Jun 9 16:02:11 1988 --- Viewport.c Thu Jun 9 16:02:58 1988 *************** *** 210,227 **** w->form.default_spacing = 0; if (w->viewport.forcebars) { if (w->viewport.allowhoriz) clip_args[1].value = (XtArgVal)CreateScrollbar(w, True); if (w->viewport.allowvert) ! clip_args[0].value = (XtArgVal)CreateScrollbar(w, True); } - clip_args[2].value = (XtArgVal)Max(w->core.width,1); - clip_args[3].value = (XtArgVal)Max(w->core.height,1); - w->viewport.clip = XtCreateWidget( "clip", widgetClass, new, - clip_args, XtNumber(clip_args) ); XtManageChild( w->viewport.clip ); /* see ChangeManaged() */ } --- 210,229 ---- w->form.default_spacing = 0; + clip_args[2].value = (XtArgVal)Max(w->core.width,1); + clip_args[3].value = (XtArgVal)Max(w->core.height,1); + w->viewport.clip = XtCreateWidget( "clip", widgetClass, new, + clip_args, XtNumber(clip_args) ); + if (w->viewport.forcebars) { if (w->viewport.allowhoriz) clip_args[1].value = (XtArgVal)CreateScrollbar(w, True); if (w->viewport.allowvert) ! clip_args[0].value = (XtArgVal)CreateScrollbar(w, False); ! XtSetValues(w->viewport.clip, clip_args, 2); } XtManageChild( w->viewport.clip ); /* see ChangeManaged() */ } *************** *** 691,695 **** --- 693,700 ---- return XtQueryGeometry( ((ViewportWidget)w)->viewport.child, constraints, reply ); else + { + *reply = *constraints; /* give him whatever he wants */ return XtGeometryYes; + } } *** Box.c.orig Tue Jun 7 13:46:09 1988 --- Box.c Tue Jun 7 13:45:32 1988 *************** *** 232,239 **** --- 232,242 ---- constraint->request_mode &= CWWidth | CWHeight; if (constraint->request_mode == 0) + { /* parent isn't going to change w or h, so nothing to re-compute */ + preferred->request_mode = 0; return XtGeometryYes; + } if (constraint->request_mode == w->box.last_query_mode && (!(constraint->request_mode & CWWidth) || -- +*************************************************************************+ * Dana Chee (201) 829-4488 * * Bellcore * * Room 2Q-250 * * 445 South Street ARPA: dana@bellcore.com * * Morristown, NJ 07960-1910 UUCP: {gateways}!bellcore!dana * +*************************************************************************+